Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Python 2.5 Released 228

dominator writes "It's been nearly 20 months since the last major release of the Python programming language, and version 2.5 is probably the most significant new release of Python since 2.2. The latest release includes a variety of additions to the standard library, language extensions, and performance optimizations. This is a final release, and should be suitable for production use. Read the release announcement, the highlights, what's new, and download it."
This discussion has been archived. No new comments can be posted.

Python 2.5 Released

Comments Filter:
  • by Scarblac ( 122480 ) <slashdot@gerlich.nl> on Tuesday September 19, 2006 @01:53PM (#16139180) Homepage
    Because 90% of programmers only know the simplest languages.
  • by xquark ( 649804 ) on Tuesday September 19, 2006 @02:25PM (#16139457) Homepage
    I believe this new inline conditional is just plain ugly!

    When developing computer language syntax, natural language
    imitation should not be the priority - also being different
    for the sake of being different is so very early 90s.

  • by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Tuesday September 19, 2006 @02:36PM (#16139536) Homepage Journal
    All programmers should study assembler. With an understanding of what kind of action is going on behind the scenes, programming makes a lot more sense. Then they should probably move straight on to OO :)
  • Hey! (Score:2, Insightful)

    by gd2shoe ( 747932 ) on Tuesday September 19, 2006 @02:38PM (#16139552) Journal
    Hey!

    This is a time and place for us python nut-cases. Ruby wackos can go release thier own new versions...

    (Just messing with you, but your comment was a cheep shot)
  • by Anonymous Coward on Tuesday September 19, 2006 @02:51PM (#16139648)
    Does anyone knows a good tutorial for application migration from Python to Ruby?
  • by a.d.trick ( 894813 ) on Tuesday September 19, 2006 @02:59PM (#16139723) Homepage

    I don't like the idea that some people make intrisicly "good" programers, and the rest are all somehow "bad"; as if some of us had bigger brains or something. Two years ago, my programming experience was limited to QBasic and a short foray into Visual Basic. I was a bad programmer. Fortunatly for the sake of humanity I stayed away from the computer for the most part at that point, otherwise I'm pretty sure something of mine would have ended up on thedailywtf.com.

    Then I started to play around with other languages (PHP, JavaScript, Lisp, and Python) and over the course of a year, two the way I saw programming, changed. No dove came down from heaven with a booming voice. It was just my mind getting practice at building beautiful algorithms. The samething happened to me when I took up piano, singing, woodworking, and many other things.

    So the question is not so much are you good enough to learn C, but are you willing to take the time. In C, algorithms tend to be quite a bit more complex than they are in Python, and further removed from our common speach. But it's not impossible.

  • by Anonymous Coward on Tuesday September 19, 2006 @03:08PM (#16139818)
    How is this any different than:


    try:
        foo = someDict[key]
    except KeyError:
        return None
    return myCrazyFunction(foo)
  • by ubernostrum ( 219442 ) on Tuesday September 19, 2006 @03:12PM (#16139842) Homepage

    I didn't mean that they only used some functions, but simply that they didn't write those functions or anything, they're just linking a library and exposing the API to Python. This is really no different from having a perl module with a loadable module, except how it's distributed.

    Nope. It's a module. The entire module is right there for you to use. Not some headers, not a few functions, the whole thing.

    I'm sure you can compile it out, but putting the sqlite library into the base distribution is, IMO, stupid. It only makes base larger and more complex.

    Except it doesn't. Python the language has not gained native support for SQLite. Nothing having anything to do with SQLite has been "compiled in" to the core language. A module which provides a Python wrapper around the SQLite API is now included among the libraries in the standard Python distribution. If you don't need it, don't ever import it in a program. Simple as that. If you do need it, importing from the pysqlite2 module is always guaranteed to work on Python 2.5, because you no longer have to go download that module from somewhere.

  • by masklinn ( 823351 ) <slashdot.org@mCO ... t minus language> on Tuesday September 19, 2006 @03:13PM (#16139856)

    Damn, missed that one.

    Now I know that's just me (well, not just me) but doesn't it make sense to keep the distribution light?

    No. It makes sense to keep the core language light, but it definitely does not make sense to keep the standard library "light". And it would go against Python's philosophy of being offered "batteries included".

    It makes sense to keep standard libraries high-quality, and fast, but stdlibs are great assets of computing languages. Many think that more than a language failed because there was no quality, extensive standard library (Common Lisp comes to mind).

    Now extensive third-party repositories such as CPAN or easy-to-install third-party libs such as Ruby's gems do make sense, and are also great assets to a language not to be underestimated, but stdlib functions just give much more (potentially misguided though) confidence about quality, and they create common idioms across the language.

  • by the_wesman ( 106427 ) on Tuesday September 19, 2006 @03:18PM (#16139887) Homepage
    "When developing computer language syntax, natural language imitation should not be the priority"

    I could care less about inline if statements - I assume that those are only for people who either are the dangerous kind of lazy, like to write hard-to-read code or don't use emacs

    in response to your 'natural language' comment, I'm hoping that isn't the reason that this was done because the if/else syntax we already have imitates natural language.

    If she is hot, hit on her. else, if she is not hot and I'm drunk hit on her. else go home.

    looks like natural language to me.
  • by masklinn ( 823351 ) <slashdot.org@mCO ... t minus language> on Tuesday September 19, 2006 @03:22PM (#16139927)

    It has features from many languages. That's why it's so easy to learn. Whatever your programming style, you can probably do it in Python.

    Well python is a multiparadigm language and fairly flexible, but it doesn't go far beyond OO, imperative and lightweight functional styles.

    It's not fit at all for logic programming, DBC and AOP are not that cool (even though decorators make them at least possible without being too damn ugly), and hardline functional programmin is impossible due to lack of support for recursions (Python doesn't optimize tail-recursion), absence of pattern-matching and mutable states.

    Oh, and it has no support whatsoever for distributed or heavy concurrent programming.

  • by smallpaul ( 65919 ) <paul@@@prescod...net> on Tuesday September 19, 2006 @03:32PM (#16140029)
    I thought I dispelled this myth years ago.
    Here is the story as presented by Paul Graham (a famous Lisp expert). Of the three languages he chooses to discuss, Java, Perl and Python, Python is considered cooler (if not more popular) than Perl and Perl cooler (if not more popular) than Java because Python is most like Lisp of the three. Unfortunately, Python is a sort of immature Lisp which may over time grow into its full Lisp-yness but why wait around when you could just be using Common Lisp today? I'm sure if you are a Lisp programmer, it is a compelling story. Unfortunately it does not ring true.
    http://www.prescod.net/python/IsPythonLisp.html [prescod.net]
  • by xTantrum ( 919048 ) on Tuesday September 19, 2006 @03:45PM (#16140154)
    I have to agree, i don't see why GVR couldn't have just fashioned it the same as the ternery operator in C. I love python not only for its RAD ability but the syntax: clear, terse and indented. Since they added decorators i've been getting more and more irritated with it. keep it clean, keep it concise. WHY BE DIFFERENT FOR THE SAKE OF BEING DIFFERENT!
  • by CaptainPinko ( 753849 ) on Tuesday September 19, 2006 @03:46PM (#16140165)
    We all know whats going on under the hood... the point of a programming language is to abstract out the "under the hood" and present it in a more semantically appropriate format. Our code doesn't remind us that memory is read into registers and then processed... but we all understand that. It's good to understand offsets, but there is no reason for our languages to reinforce that and make us say stupid things like "the zeroth element".
  • by fuzz6y ( 240555 ) on Tuesday September 19, 2006 @03:55PM (#16140274)
    I don't like the idea that some people make intrisicly "good" programers, and the rest are all somehow "bad"; as if some of us had bigger brains or something
    Every skill is a function of talent and training. The cornerstone of elitism is to grossly overestimate the role of talent, but to dismiss it altogether is no less foolish.
  • by Haeleth ( 414428 ) on Tuesday September 19, 2006 @04:40PM (#16140734) Journal
    If she is hot, hit on her. else, if she is not hot and I'm drunk hit on her. else go home.

    looks like natural language to me.


    Looks rather unnatural to me. The usual way to say it would be more like "Hit on her if she's hot or you're drunk, else go home."

    Which, I realised as I typed it, is exactly how Python's new inline conditional syntax works. Neat.
  • by ciggieposeur ( 715798 ) on Tuesday September 19, 2006 @04:54PM (#16140876)
    About half a year ago, I tried to get into Lisp. It sounds like the holy grail - execution speed and error checking of a compiled language with all the speed of development of more dynamic languages. Perhaps s-expressions should be perfectly suited for HTML too (I'm still stuck in this web app world, at the moment). So I picked up Practical Common Lisp, installed SBCL, joined some mailing lists, found some libraries, got experimenting...

    Two things meant I got disinterested in a month or so: it has far too many slightly-differently-named functions in the standard language, many with non-obvious names too (that's what PHP gets its harshest criticism for); and also the huge library of things you need nowadays (internet stuff, databases, OS stuff, etc) is either missing or rather undeveloped.


    All very true criticisms. I too have switched my new code to Lisp for the purpose of being a better programmer (and because I've got two years in a MS program to get my basic math toolset switched over). It IS getting better, and faster at that. I think we're approaching critical mass of people adopting it and pushing it into the Python/Java/Perl/etc. space with sockets, threads, SQL, UFFI (now CFFI), etc.

    I think the biggest problems I've got with Lisp are packaging, pathnames, and the REPL.

    Packaging means ASDF, which I don't like at all compared to Java or Perl's filesystem packages. To get a package with dependencies to work OK, you've got to create a .asd file and add a defpackage to either a separate .lisp file or your main one, and the .asd specification is not documented well (the wiki page for setting up sub-modules is flat-out wrong).

    Pathnames ... UGH. I've already had to write my own version of a java.io.File just to have a string that is guaranteed to refer to an actual file.

    REPL. Well, it's very nice to be able to talk to a running Lisp, especially when the Lisp is an application server and you want to alter some values or force a reload of an app, or just to poke around and see what kind of stats have been collected. However, the distinction made in the spec between compile-time, interpret-time, and run-time for code makes some things difficult, e.g. defconstant is completely useless with SBCL. I like REPL, every book should mention it, but they should very quickly move OFF REPL and show people how to just load a .lisp file and run it. The implementations should also make it easier to tune the output of the Lisp (try to get compile-warning's squished in SBCL, it's not pretty).

    I would LOVE (and gladly buy two) copies of a book that had this information in it:

    1. What is Lisp, and where to find the community web sites
    2. How to locate, download, and install all the major Lisps on Linux, Mac, and Windows
    3. Basic language grammar, including CLOS
    4. How to use ASDF (including complex examples)
    5. How to fully interface with the operating system, including implementation-specific functions for file i/o, network i/o, command-line arguments, the environment, threads, and more
    6. How to package a standalone Lisp application to deliver to customers
    7. How to use UFFI
    8. How to set up a Lisp web application server (modlisp or Araneida or ...)
    9. How to use the most common libraries: CLSQL, OpenGL, SDL

    I know Lisp'ers love (and I do too) the fact we've got a spec and multiple implementations, but dangit if it isn't really difficult to get it all together and be able to actually DO something with it within a couple weeks.
  • by Waffle Iron ( 339739 ) on Tuesday September 19, 2006 @09:17PM (#16142872)
    there is no reason for our languages to reinforce that and make us say stupid things like "the zeroth element".

    Array indices don't point at elements; they point between them. The "first element" doesn't make much sense either since it actually occupies the whole imaginary fractional space between 0 and 1. People who don't understand this saddle the world with things like date systems where the years are counted ..., -2, -1, 1, 2, ...

    So a language arbitrarily picks whether an index refers to the element to the right or to their left. I've used both, and each way has annoying special cases. However, counting from 0 seems more natural for a lot of manipulations that combine ranges or use a modulo operator to create indices, and it has the advantage of not needing an extra bit in the index when handling arrays with a power-of-two size.

  • by smallpaul ( 65919 ) <paul@@@prescod...net> on Wednesday September 20, 2006 @12:09AM (#16143654)

    All programmers should study assembler. With an understanding of what kind of action is going on behind the scenes, programming makes a lot more sense.

    Perhaps they should also learn microcode because without that, you won't know what's going on behind the scenes in Assembler. And then to understand the microcode, maybe you need to understand electronics. And to understand the electronics, you should understand physics. So all programmers should understand Maxwell's equation lest they not know what's going on "behind the scenes."

  • by Garrett Fox ( 970174 ) on Wednesday September 20, 2006 @12:29AM (#16143745) Homepage
    You jest, but it is good to learn as many aspects of a problem as possible. The extreme opposite case would be a programmer who thinks he's a whiz at giving magic incantations to the glowing mystery box, and ends up sacrificing AOL CDs to it when it breaks.

    In education in general, I'd like to see everyone know how to make things like one of those shaking-powered flashlights. A hands-on program like that would give people more of a sense of ownership over science and technology.
  • unwind-protect (Score:3, Insightful)

    by Nicolay77 ( 258497 ) <nicolay.g@ g m a i l.com> on Wednesday September 20, 2006 @03:14AM (#16144248)
    So this is like Common Lisp unwind-protect special form.
    Nice feature :)

    Ohh sorry, I just forgot that Python is trying not to be more Lisp-like!! :P

The one day you'd sell your soul for something, souls are a glut.

Working...