Slashdot Mirror


Python 2.0 Released

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.

28 of 89 comments (clear)

  1. Re:Python is better than perl by rodgerd · · Score: 2
    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.

    C and Pascal, surely.

  2. Re:Time to start learning by cduffy · · Score: 2

    I've not tried (and don't particularly plan to try) any CGI stuff with Python, except via Zope modules.

    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.

  3. Re:An honest answer by cduffy · · Score: 2

    Yah, but that's intentionally tackling the steepest part of the learning curve first. Why not start with something with a smoother slope, learn most of the base concepts there (general algorithmic design and the like) and move to C once all the "easy" stuff is out of the way rather than trying to take it all on at once?

    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.

  4. I thought Linux and Open Source.... by DAldredge · · Score: 2

    I thought Linux and Open Source was about producing the best product...Not which product has the most endorsements. Look and Windows, it has a lot of endorsements but that does not mean that it is the best...

  5. Re:Great by scrytch · · Score: 2

    Funny, when I pasted that in, it didn't work. Could be because it wasn't indented. So much for block delimiters

    --
    I've finally had it: until slashdot gets article moderation, I am not coming back.
  6. Python followed by C++ by EnglishTim · · Score: 2
    I would suggest that you start with Python - there are several reasons for this:
    • You can run python as an interactive interpreter, which is very useful when you're learning. It means that you can test out a line before committing it to code, just to see if it works. You can also query the data your program uses from it.
    • Python is quite an elegantly structured language, and it gives quite a nice introduction to Object Orientation.
    • Python code is very easy to read. I find that when I'm learning a language, I spend a lot of time looking at other people's code - you should find that fairly easy in Python.

    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

  7. Re:An honest question. by hey! · · Score: 2

    The best way to learn programming is to solve lots of different realistic problems. Although C can do anything Perl or Python do, many kinds of problems will be within your grasp with these languages that would be to advanced in C. So, I think either language could be a good way to learn to program. You learn more from at least partial success than you do from utter failure.

    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.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  8. Re:An honest question. by MemRaven · · Score: 2
    Oh, Lordy, not this again.

    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:

    • It's the only way to beat recursion into your brain so badly you'll never forget it.
    • I had to study it at the MIT AI lab and since that was the best place ever, so should you.
    • We have to get some higher level concepts into you before you do 3.5 more years of nothing but C++ and C and assembler.

    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.

  9. Full XML support? by E1ven · · Score: 2

    What is meant by "full XML support"? I ¥briefly, admittedly looked over the page, but I didn't see it explained©
    Wouldn't that be like saying "Full Ascii support"?
    How does a programing language support a document format?
    Does it have some sort of built in parser?

    ¥Not trolling, just curious
    --

    This message brought to you by Colin Davis

    --
    Colin Davis
  10. Re:Too structured? by dbarclay10 · · Score: 2

    It depends on how you look at it, and that's why I said it "may" be too structured. It goes back to the way people think. I, for instance, never fully understood object-oriented programming until I started using Python. It just wasn't the way I thought. It made learning any sort of C++-type language(including Java) very difficult.

    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 ;) I just wish that the GTK+ and GNOME Python bindings actually looked like something vaguely resembling Python. As it is, the bindings look like C functions. I think they're ugly. :)

    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,

    --

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)
  11. Re:Pickle Function ? by err666 · · Score: 2

    How should I know. Probably yes, if you plan to do any Python programming. Pickling objects is what is called "serialization": you can store any object hierarchy to disk/database/whereever and get this object hierarchy back later. This works across the network and across platforms, of course :-)

    --
    reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
  12. Re:Perl6 times infinity? by supersnail · · 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.

    --
    Old COBOL programmers never die. They just code in C.
  13. Python 2 is not compatible with GNU GPL by yerricde · · Score: 2
    According to the license:
    6. This License Agreement shall be governed by and interpreted in all respects by the law of the State of California, excluding conflict of law provisions.
    GNU GPL does not allow for choice of venue clauses (as was demonstrated in the Python 1.6 wrangling).
    --
    Will I retire or break 10K?
    1. Re:Python 2 is not compatible with GNU GPL by Lord+Ender · · Score: 3

      Python will always be Free and Open Source. No matter what it says there, that is absolutely no reason to not use the language. Don't try to create problems where there aren't any.

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
  14. Re:Great by joto · · Score: 2
    Well, if you mean operator overloading like C++ (only overload existing operators for new types), then Python has had that for as long as I can remember.

    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.

  15. Good News For Newbies! by PingXao · · Score: 2

    In a related announcement today, PC generation guru Philippe Kahn announced that his new company, "Reptilez", will be offering "Turbo Python" for all Windows development environments in the 1st quarter of 2001.

    For further information please direct your inquiries to ..., uh, well, umm, ..... When they get his email up and running we'll provide the address!

  16. Re:Great by Lord+Ender · · Score: 2
    This is python, man. You don't need to heave semicolons at the ends of each line. and you need to indent your code. If you want to make python look like C you do it like this:



    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.

    --
    A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
  17. Pickle Function ? by tealover · · Score: 2

    Do I really want to know what this function does?

    --
    -- You see, there would be these conclusions that you could jump to
  18. Monty Python 2.0 by Cerlyn · · Score: 2

    So we get to see all new episodes! Great!

    I'm not dead yet!

    (Sorry, couldn't resist....)

  19. Re:Great by gunga · · Score: 2

    Although I wish there was support for C style {bracketing} for statements

    Of course you know it does as Fredrik Lundh wrote:
    In fact, Python already supports block delimiters:

    if foo: #{
    foo1();
    foo2();
    foo3();
    #}


    Hum!

  20. If it's good enough for ESR by Anne+Marie · · Score: 2

    Then it's good enough for me. Does the perl commnity have any plans to get a ringing endorsement from such a public opensource figure? I mean, besides Larry Wall, of course. We geeks may make these decisions on their technical merit, but it really helps the suits if a celebrity pitches it to them.

    --
    -- Anne Marie
  21. Re:Python is better than perl by |deity| · · Score: 3
    Here's a little link from the python faq.

    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 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.

    --
    Environmentalists are their own worst enemy. ~tricklenews.com
  22. Moose 3.1 by MyopicProwls · · Score: 3
    In a related move, God has released Moose 3.1, which is mostly a bug fix release of the popular mammal, though some extra features include increased moose nugget production and and option for larger horns.

    "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

    --

    MyopicProwls
    My homepage

  23. Re:An honest question. by RevAaron · · Score: 3

    I agree. Even Smalltalk, a purely OO language, handles lambda better. It's also geared at a similar begining to program audience.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  24. Why? by Anonymous Coward · · 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.

  25. Re:An honest question. by dbarclay10 · · Score: 4

    Well, there are pluses and minus to using either Perl or Python as a first programming language:

    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,

    --

    Barclay family motto:
    Aut agere aut mori.
    (Either action or death.)
  26. The REAL whats new for Python 2.0 by crisco · · Score: 5
    The link provided is a little misleading as it goes one by one through the release candidates, take a look at What's New in Python 2.0 for a better list and an explanation for the quick release of Python 1.6 followed by 2.0 in just a few months. Also explained is the newer development process.

    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.

    --

    Bleh!

  27. Real Python experiences from a VB wonk by Da+VinMan · · Score: 5

    Just wanted to throw out some thoughts on why I steered the project I'm currently working on towards Python. My background is mostly in the MS suite of things. I also know Java, Python, Smalltalk, LISP, C, C++, and I've tinkered with Perl, REBOL, Prolog, etc. so I'm no MS bigot; that's just the majority of my experience.

    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 .NET initiative may push VB into the cross-platform arena soon, it won't be soon enough for me.

    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 .NET world, and throw in Zope for good measure.

    Python is a VERY strong VB replacement contender.

    --
    Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!