Python 2.0 Released 89
atallah writes: "It would appear that the long awaited Python 2.0 was finally released today. The front page of the Web site has the announcement." According to that announcement, Python 2.0 will receive minor-version updates around every 6 months, even as work begins on the shoot-for-the-moon Python 3000. For the curious, here's the list of what's new in 2.0; the list includes "full XML support and several forms of new syntax," as well as the BeOpen label.
Re:If it's good enough for ESR (Score:1)
Re:If it's good enough for ESR (Score:1)
GPL Compatability? (Score:1)
Re:Time to start learning (Score:1)
If you're just mashing text and doing database lookups you'll have a slightly harder time than in Perl, since Perl's DBI is better (Python's catching up, though) and RE's are part of the language (not that I think that's a good idea in general, but if you're messing with text it's great). You can still use the exact same REs from Perl in Python, but you'll have to type a little bit more!
Python's beauty really shows when you've got big projects, which most CGI scripts aren't. But it's still pretty good.
Python 2.0 (Score:1)
Big, long, scaly deal.
Re:Time to start learning [update] (Score:1)
However, in doing so, they found that I gave the wrong link. See sourceforge.net/projects/dtmc; there are no releases, but the code is in CVS. The build process needs a major overhaul, but you should be able to tweak it into operation.
Debian? (Score:1)
--
Re:Time to start learning (Score:1)
If you are happy with doing CGI at a raw sort of level -- you get a dictionary (hash-table) of posted variable and print to stdout -- then there's no reason you can't do it in Python.
If you want to see a moderate-sized CGI program, you can look at ComfyEdit [colorstudy.com], which I made. I think it's reasonably accessibly while still having some novelty. Well, no, I take that back -- I just looked at it, and it's really rather monolithic.
--
obligatory link to slashdot python v perl flamewar (Score:1)
Some very valid and interesting points brought up about both languages. I know this story is about python and not perl, but whenever anybody discusses one the other is bound to come up in conversation.
Re:Great..... (Score:1)
Ignore this (Score:1)
Re:Great (Score:1)
So python doesn't allow operator overloading? if it did you coulda done it yourself. and that's no fun not having
operator overloading. it's always good to make a class whose + operator subtracts and whose - operator adds. or
something...
What are you talking about? Python has had operator overloading for as long as I have used it (which is only since version 1.5
Re:Python is better than perl (Score:1)
Re:GPL Compatability? (Score:1)
One of the great things about Python was that you can embed it in your own code, without having to open the whole of your code. That's very useful.
It'd be okay if it was released under the it's normal (BSD-style) license and the GPL, though...
Re:GPL Compatability? (Score:1)
Re:GPL Compatability? (Score:1)
And yes, afaik.
-lx
Re:I thought Linux and Open Source.... (Score:1)
Exactly. Endorsements provide an excuse not to think. For example, consider the recent posting on Slashdot today about techies endorsing Gore...
Perl6 times infinity? (Score:1)
I'd rather use Perl6 than something that resembles Visual Basic.
//Humming
Python & GPL (Score:1)
I wonder what Debian will do about this...
Either stick to 1.5 or remove all GPL apps that don't update their license in order to use 2.0.
Re:If it's good enough for ESR (Score:1)
Snake Logo (Score:1)
Re:I thought Linux and Open Source.... (Score:1)
Re:An honest question. (Score:1)
That said, I think perl would be a horrible choice for a first programming language. A little structure from a language is actually a big benefit for a new programmer. It helps to prevent yourself from shooting yourself in the foot too badly.
Also, the lessons you learn in perl may not translate well when you learn another, more traditional language. Data typing is an important concept of of programming in most languages, but perl's handling of data types would be confusing for a beginner.
I've never used python, but it sounds like a decent language. The best language for new programmers I've used is java. It's very programmer-friendly, compared to C, C++, or perl.
Cheers!
-Bruce
Re:The REAL whats new for Python 2.0 (Score:1)
It's not a rumor. It's a fact.
Re: (Score:1)
Re:Dodges annoyong posts (Score:1)
Is there any way to better filter the slashdot comments? Maybe something could be done using Mozilla's new Formzilla?
Well, if you're using Emacs [gnu.org], (and who isn't ?), then you can use the Mail/News reader GNUS [gnus.org], to view slashdot comments as if they were a newsgroup.
Doing this is so cool, because you can take advantage of both the slashdot scoring system, and GNUS filtering/kill filing.
See here [gnus.org] for instructions on setting up GNUS.
Steve
---
Re:An honest question. (Score:1)
--
Great (Score:1)
-Moondog
Re:Dodges annoyong posts (Score:1)
Re:Python is better than perl (Score:1)
This is just my opinion, but to me comparing perl and python as far as reading other peoples code is like comparing GWBASIC to Java. Pythons programmers also seem to have a programming philosophy that is more in tune with the way that I think then perl.
I of course am just beginning to learn Python, so after I become more proficient in it and perl I may decide that perl is better for some reason.
All of this doesn't matter very much in the end since I mostly program in C, C++, and Java.
Re:Python is better than perl (Score:1)
Oh well I'm just starting to learn python but I already like it better then perl.
Just out of curiousity.. (Score:1)
Re:Just out of curiousity.. (Score:1)
Re:v2.0 - 3000? (Score:1)
Yet.
Re:Obfuscated notation (Score:1)
Well, one of the primary arguments for augmented assignment was actually related to the p3k project, and optimization. The reasoning goes, that it is faster to perform self.attribute += 1 than it is to perform self.attribute = self.attribute + 1 because there is one less attribute lookup.
And while this may appear trivial, it becomes somewhat more important once you realize that Metaobject programming in Python often involves overriding the methods for getting and setting attributes with new methods. Every get/set counts.
I don't think we're about to see a flood of perl-like syntax sugar rotting the teeth out of our Python just yet. =)
Python 2.0 Beta was cool (Score:1)
Time to start learning (Score:1)
I've been reading about how it's gaining ground, but I've yet to talk with people that use it on a regular basis. Anyone care to share insight on their programming experiences with it? Specifically in use as CGI applications?
Re:If it's good enough for ESR (Score:1)
--------
Re:An honest question. (Score:1)
I agree that Python is a good beginner's language, and probably better than Scheme for this purpose. But Python's lambda is quite anemic, a pale shadow of the construct provided by more pure functional languages.
Re:Perl6 times infinity? (Score:1)
Oh, don't worry. Python is clearly headed down that road, too. 2.0 adds a number of pieces of candy (such as augmented assignment and the 'print >> <file>' construct) which add no real utility but complicate the syntax. A few more years of this, and Python will look like Perl.
Python's my favorite language/tool, but if things keep moving in their current direction, this won't last.
An honest question. (Score:1)
License update, anyone? (Score:1)
Re:If it's good enough for ESR (Score:1)
Re:Great (Score:1)
So python doesn't allow operator overloading? if it did you coulda done it yourself. and that's no fun not having operator overloading. it's always good to make a class whose + operator subtracts and whose - operator adds. or something...
Re:An honest question. (Score:1)
Too structured? (Score:1)
Re:obligatory link to slashdot python v perl flame (Score:1)
Which is really unfortunate. The two languages are extremely different. They are similar in that they are both very dynamic and both begin with the letter 'P' -- that's about it.
COOOOOOOL ! (Score:1)
Visual SlickEdit for Python (Score:1)
Obfuscated notation (Score:1)
Anyway, great to see the release - I've been using 2.0rc1 for a while now. I want my Shrubbery 2.0, Nih!
--
Re:Good News For Newbies! (Score:1)
Re:Perl6 times infinity? (Score:1)
Re:Perl6 times infinity? (Score:1)
Re:Perl6 times infinity? (Score:1)
Try them! (Score:1)
I found Python to be better suited for me, and of course I'm trying to convert everyone to Python. But I know there are (lots of) people who prefer Perl.
So, here is my unofficial "Choose between Perl and Pyhton in 2 days" guide:
Day 1
Download and install
Python at http://www.python.org/download/ [python.org] http://www.perl.com/pub/lang uag e/info/software.html [perl.com]
Download/Browse/Print (whatever suits you) some tutorials
Python at http://www.python.org/doc/current
Perl at http://ww w.c clabs.missouri.edu/things/instruction/perl/perlco
Rest of the 2 days:
Follow the tutorials and try to write some very short programs of your own.
Third day:
Go back to work with sore, red eyes.
Later: Learn them both, and C too!
Re:Great (Score:1)
Re:Full XML support? (Score:1)
Re:Three things I don't like about Python (Score:1)
Re:An honest question. (Score:1)
Also I do think that although not a popular choice, with the right tuition, C is an excellent beginners language as the concepts of any language are presented well with it, and I really don't see what's wrong with starting with it. I'd definitely recommend Java or C, both of which are widely used so there's lots of opportunities to get help if you need it, there's thousands of reference books, and if you get really desperate, ask one of us nice
Python rulaa. (Score:1)
PHP not in competition ? (Score:1)
I am using PHP and Id like to know the Pros and Cons of using Python and Perl (concerned to PHP) The only information I get while reading through those comments are comparisons about Perl and Python (and stuff like "Python is better than Perl")
I am wondering if PHP isnt in competition ? I have a good feeling using PHP, but Im not really in Python/Perl so Id like to get a small overview about those languages.
Re:Python is better than perl (Score:2)
C and Pascal, surely.
Re:Time to start learning (Score:2)
As a general app programming/prototyping language, though, Python is great. Combined with the Python libglade bindings, you can have a neat & nifty app that actually Does Something Useful in... well, let's see... I've got a toy virtual machine, compiler, parse tree grapher and graphical-debugger-style frontend for the VM in 850 lines of Python, 173 lines of C and 130 lines of lex/yacc code. Given how much stuff this code does, I think that's pretty impressive -- and most of it was done in under a week (the VM and interface, for instance, were a single all-nighter).
(If you're actually interested in looking at this code -- created to be useful for instructional purposes in basic compiler theory -- feel free to check out dtmc.sourceforge.net).
Another simple OpenGL app I wrote at one point took a single day (and most of the following night) to get running in Python. I was doing this for a class, and the prof required that I redo it in C++ (a language I know well). I tried using all the fancy language features I'd (without thinking about it) used in the Python version -- RTTI, multiple inheritance, etc. A week has passed. It's still not done, and I still have no clue what many of the compiler errors are about (eg. the linker can't find the vtable -- I've no clue what would make the compiler not spit it out).
Another thing -- you won't have to budget much time to learning Python, at least not the syntax. If you know good OOP design, then you're in even better shape.
Pardon the rambling -- I'm still not quite awake yet. Hope you get something useful out of it, though.
Re:An honest answer (Score:2)
Learning C is a much less daunting task if you already have some programming experince under your belt. While I learned C before Python (Perl is absolutely not a beginners' language, far worse for that than C), I'd advize those after me to do it the other way 'round.
I thought Linux and Open Source.... (Score:2)
Re:Great (Score:2)
Python followed by C++ (Score:2)
I think what it comes down to is this: Your first language should be as easy to use as possible, and as easy to get results with as possible. It's more important that someone gets encouraged and continues programming, rather than giving up than it is to ensure that they've learned good programming habits. That's why BASIC was such a good language to learn with. (I learnt on BBC Basic) Of course the nice thing about Python is that I doubt it would encourage many bad habits
And anyway, you can un-learn bad habits.
Once you are happy using Python, have a go at C/C++ - it is the de facto standard in computing languages, and you'll get to learn all about the wonderful world of memory management...
cheers,
Tim
Re:An honest question. (Score:2)
When I was a kid, there was lots of talk about people getting "accents" from the various languages they learned. I think this was somewhat exaggerated, but you do pick up certain habits. For example Scheme encourages you to make small functions, not the least because its a pain in the ass to look at all those damned parentheses. Python is designed to remove a lot of pitfalls for learners and encourage generally accepted good style. Perl, on the other hand, tends to glory in a diversity of approaches, not all of which are always good. I think that just sitting down and hacking Perl without guidance might tend to run on functions and obscure expressions. The "More than one way to do it" philosophy is tough on newbies, especially because there aren't really good standard normative examples of Perl style (the best thing about C? Most people learn from K&R).
I'd say that if you have a really good Perl programmer to work with, then Perl would be a good choice. If you are learning on your own, then Python is going to prepare you to transition to other languages better.
Re:An honest question. (Score:2)
While the pedants at many universities have decided that this is the Best Book to teach people how to program (and that's always how they label it) learning to think in lambda calculus and fake objects using lambdas is really never the way to go. I asked once why they did it, and the response was that:
If people are going to insist on teaching something trivial in the beginning, why must it be scheme? Why not Python? It gives most of the same features (even lambda calculus) and is just so much easier to learn and prepare for C++ or Java. Perl doesn't really do either.
Re: (Score:2)
Re:Too structured? (Score:2)
Now, if you think in a very abstract fashion, you might find that Python demands too much in its structure(things like naming conventions of the builtins, forced indentation, coersion). Unfortunatly, most average people *do* think in a very abstract way.
I learned Python really quickly because it reminds me a lot of a functional language. Because I could learn the basic language naturally, I eventually disconvered exactly what object-orientation entailed, and what it could be used for. Python was my intermediate step. I still like it, but I've also been able to learn Java. Heck, I more than like Python, I use it every day
Not that I mind - I didn't write them, and I appreciate the people who did
Okay, enough rambling.
Dave
'Round the firewall,
Out the modem,
Through the router,
Down the wire,
Re:Pickle Function ? (Score:2)
Re:Perl6 times infinity? (Score:2)
I personally see no resemblance between Python and Visual Basic.
In fact there is a stronger resemblence between Perl and VB. Both started out as simple "basic" languages, with simple sysntax, for doing simple things. Over the years various extras have been bolted on, stick with on chewing gum, or, tied on with string, which has created an unholey mess.
I admit that Larry Wall et al,are fighting a valient rear guard action and trying to clean up the mess, but once you release a feature its very hard to withdraw it.
Python on the other hand was designed from the begining to be an OO scripting language. It was designed from the begining to perform comlex tasks. Guido Van Rossum took a long hard look at the shortcomings of Perl, TCL, VB & etc. and took great pains to avoid repeating these mistakes.
On the downside, the runtime is massive, and, there it is a massive amount of coding to produce a fully fledged python object in C.
Python 2 is not compatible with GNU GPL (Score:2)
Re:Great (Score:2)
However, it seems you mean the ability to create new operators ala Haskell or ML (new operators, select associativity and precedence yourself). This is not supported. Whether it will be remains to be seen (not likely, I guess). It probably makes some sense for some applications, but can also make things very unintelligible.
However += and friends can't be functions as they have side-effects, and unless you have a real macro-system in the language (or a not so real macro-system such as the C preprocessor) you will never be able to create this kind of operator/function yourself. Therefore it needs special support in Python.
Good News For Newbies! (Score:2)
For further information please direct your inquiries to
Re:Great (Score:2)
if foo: #{
foo1()#;
foo2()#;
foo3()#;
#}
There. Now you have python that looks like C. Of course, when Guido designed python, he realized how worthless the semicolons are and left them out. But you can still have them if you want them.
Pickle Function ? (Score:2)
Monty Python 2.0 (Score:2)
So we get to see all new episodes! Great!
I'm not dead yet!
(Sorry, couldn't resist....)
Re:Great (Score:2)
Of course you know it does as Fredrik Lundh wrote:
In fact, Python already supports block delimiters:
if foo: #{
foo1();
foo2();
foo3();
#}
Hum!
If it's good enough for ESR (Score:2)
Re:Python is better than perl (Score:3)
Which editor has good support for editing Python source code?
On Unix, the first choice is Emacs/XEmacs. There's an elaborate mode for editing Python code, which is available from the Python source distribution (Misc/python-mode.el). It's also bundled with XEmacs (we're still working on legal details to make it possible to bundle it with FSF Emacs). And it has its own web page:
http://www.python.org/emacs/python-mode/index.html [python.org]
There are many other choices, for Unix, Windows or Macintosh. Richard Jones compiled a table from postings on the Python newsgroup:
http://www.bofh.asn.au/~richard/editors.html See also FAQ question 7.10 for some more Mac and Win options.
Hope this helps. Like I said above I'm just beginning to learn python so my knowledge is somewhat limited. I just like what I've seen so far.
Moose 3.1 (Score:3)
"I'm sorry", said God, "but the release schedule for Human is to be set back again." God went on to specify that Human 1.0.1 is having trouble making it to beta due to a hairy bug in the evolution code in Kansas.
MyopicProwls
Re:An honest question. (Score:3)
Re:Python 2 is not compatible with GNU GPL (Score:3)
Why? (Score:4)
Why would you use a lame language like Python or Perl
Every one knows that the best language is Visual Ba
This post has performed an Illegal Operation and will be shutdown.
Re:An honest question. (Score:4)
Perl Pluses:
You'll probably learn the value of making code readable. Perl is notorious for unmaintainable code.
Perl follows the, "There's more than one way to do it" philosophy, so you'll likely find that Perl programs you write more closely follow your thought/reasoning patterns.
Perl Minuses:
Because there are so many different ways of accomplishing the same goal, it might take longer to learn the language since you'll really have to think about what you want to do.
Python Pluses:
Very structured language - makes it easier to navigate for a beginner.
There are fewer ways to do one thing than with Perl, so it'll probably be quicker to learn the entire language. There arn't as many "gotcha"s.
Python Minuses:
Might be too structured for a beginner, but I've found it easier to teach than most other languages.
Sometimes it's a pain to do what you want, and you might have to go about it in a roundabout way.
Just my two cents, based on rather limited experience
Dave
'Round the firewall,
Out the modem,
Through the router,
Down the wire,
The REAL whats new for Python 2.0 (Score:5)
The changes seem to be an incremental evolution of the language, not a groundbreaking new language. But if you are a language / tools junkie like me, you owe it to yourself to take a look, even if you're turned off by the rumors of mandated indenting.
Real Python experiences from a VB wonk (Score:5)
First of all, why did we choose Python? The project is basically fat client, and could have been done with almost any development environment.
In our case, Java and VB were the other primary contenders. We need a rapidly developed application that is cross-platform. The customer doesn't have much money at this point, and therefore not much time either. Therefore Java is out. That seems counter-intuitive right? Java is supposed to save a lot of time after all. However, that's only true when you compare Java development time to C or C++ development time. Compare Java's development time to VB or Python's, and it's a completely different story. Java just didn't seem to work at a high enough level of abstraction to get the job done.
So, why didn't we use VB? That's simple: it's developed for, and stays on, Windows. And that's it. Yes there are products that will let you translate VB to Java. There are some cross-platform Basic products out there. Have you used them though? They don't get the job done very well. And they normally leave it to you to figure out where a translation/cross-compile goes wrong. All in all, it just doesn't have a professional feel to it. Also, while the
Now, I suppose we could have used Perl, but frankly I fear Perl. Why? Because of the very flexibility it asserts as an advantage. Yes, I can write the solution in pretty much the way I think. Given the fact that I have yet to find two people who think about a problem in the same way though, that's a maintenance problem in what may become a large project.
Once I selected Python on a preliminary basis, I had to make sure it would actually work. I developed GUIs for it with no problem. We did an XML proof. I did proofs on its object capabilities. I looked at sites and applications developed in Python. Could it handle the (relatively tiny) needs of my project? You bet it can. It can do all of that and more.
Anyone who wants a relatively impressive sample of what Python can do should take a look at http://wildsau.idv.uni-linz.ac.at/mfx/pysol/. It's a huge (free!) solitaire game with all sorts of options and games. I haven't seen anything else like it come from the other scripting languages (not picking on any one language here though), except VB, and that is not on the list. Pile that game on top of the fact that Python gets used for server-side applications, has two companies actively working on its development (BeOpen and ActiveState), can be used in the JVM (JPython), will be usable in the MS
Python is a VERY strong VB replacement contender.