Slashdot Mirror


Python 2.3 Final Released

An anonymous reader writes "Nineteen months in the making, Python 2.3 has just been released. With a plethora of changes since version 2.2, this release is definately worth the upgrade. Be sure to read the Release Notes and the Highlights file for more information."

13 of 371 comments (clear)

  1. impact... by alienhazard · · Score: 2, Interesting

    I wonder what this means to the people at blender who just updated the python API

    --
    > "I allege that SCO is full of it" -Linus
  2. Reviewing a book 101 by Anonymous Coward · · Score: 2, Interesting

    What did it help you do? Work on your reading skills? Start your camp fire? Reach the top shelf?

    How did it help you? Did you really need help? If so was this book uniquely helpful or do you think others would have helped too?

    Are there other reasons why it was great? Was the author witty and entertaining? Or was he dry and to the point? Was his writing unusually clear and illuminating? Did he "speak to you"?

    I'm not saying every comment here has to be a full book review, just that yours was devoid of any helpful content.

  3. question to practical programmers by Maimun · · Score: 4, Interesting

    At the top of the list of new features they have sets. The first paragraph says that sets are implemented by hashtables. I wonder whether it is really meaningless from the "practical" point of view to implement sets with data structures like red-black trees or Fibonacci heaps. The advantage of the latter over hashtables is a solid bound on the worst case running times.

    1. Re:question to practical programmers by Ed+Avis · · Score: 3, Interesting

      After the recently-implemented algorithmic complexity attack against many hash table implementations (story on Slashdot a couple of months ago), many more programmers have reason to be concerned about the worst case. If you are hashing inputs taken directly (or perhaps even indirectly) from the user, then by choosing the right strings an attacker can DoS your system by making lots of hash collisions, so each lookup becomes effectively a linear search.

      I don't know what Python (or other scripting languages) are doing to address this; many on the Python newsgroup seemed not to care and said that the operating system should deal with any process which is using too much CPU time, but I don't know if this attitude is shared by the real Python developers.

      Perhaps for security-conscious applications you could choose to use red-black trees or some other implementation of associative arrays, at least in cases where strings sent by the user are used as part of a hash key. Perhaps Perl's tainting mechanism could help with this.

      --
      -- Ed Avis ed@membled.com
  4. Re:Why Python is good at our university by bsharitt · · Score: 3, Interesting

    It could be worse, people could be learning Basic instead of Pascal and Java. At least they are slightly similar to C. I start programming with Basic and it's haunted me ever since.

  5. Re:I see whitespace is still syntactically relevan by Big+Sean+O · · Score: 2, Interesting

    Most of your problems would be fixed with a good python-aware editor.

    Putting a large block of code into a while or for loop.

    Well, if you had a large block of code to insert, why not make it a function and call it. Also, when you're working with Python, you quickly learn (or assign) the "entab" and "detab" commands, so inserting the tabs aren't a problem.

    TABS and order of whitespace

    Most people have their editors convert tabs to spaces

    For decently-complex programs there might be so many nesting levels that the indented code is spaced so far inwards that one needs ridiculously-wide displays for sanity.

    Someone who is using 10 levels of nested blocks isn't effectively refactoring. Extract method now and then... :-)

    --
    My father is a blogger.
  6. Nice Amazon scam buddy by Voivod · · Score: 2, Interesting

    The only point of your post was to get your nice referral bonus for all the Slashdotters clicking through to Amazon.

    Moderators should know to look out for this... it's way worse than karma whoring. Did you even read this book? I wouldn't be wondering this if your post wasn't so clearly a cash grab.

    If so, it might help if you wrote something useful about why you're recommending it! (And I don't mean cut-n-paste from an Amazon review either...)

  7. Re:Its 20-30% faster !! by ansible · · Score: 5, Interesting

    Out by an order of magnitude, and not getting closer any time soon. Last I checked, it's out by a factor of 100 or so for small operations (loops, etc)

    Well, regular Python code can see some dramatic speedups, with just a little bit of extra work. Check out Psyco if you firmly believe that interpreted languages will never ever be as fast as C.

    With sufficient cleverness, it may be possible to boost Python beyond the speed of the most highly optimized pre-compiled program.

    Psyco and approaches like it do have drawbacks, but there is some very interesting work going on now with high-level languages.

  8. Re:I see whitespace is still syntactically relevan by Tyler+Eaves · · Score: 2, Interesting

    easy solution.

    while something someval: #{
    do.something()
    while x 10: #{
    print x
    #}
    #}

    --
    TODO: Something witty here...
  9. Re:Platform Competition? by GooberToo · · Score: 4, Interesting

    This is a common saying when you talk with Python/Java programers. Plus, with something like wxPython, you can have a slick client application to boot.

    Last time I saw unbiased performance comparisions, the difference between Python and Java wasn't really worth talking about.

  10. Re:Why Python is good at our university by Ianworld · · Score: 2, Interesting
    At my school the basic programming course teaches 3 languages

    The first is NetLogo because its really awesome and you can do great things with it very easily. Ever try to simulate the spread of diseases in a C program??? The second is Dr Scheme which is a newer form of LISP. Teaches kids how to use functions and recursion. And the tortures of syntax. I just love () now. Rather i love (((()))) now. That portion of the course is concluded by us making our own number system with simple arithmetic functions. I think we used A's to represent a unit. Finally we conclude with Python. Basically it teaches us how to use a liner programming language.(none of the others really read top to bottom.) Overall a very good course. They also teach an introductory course that spends a whole term on python. Python has everything the more advanced languages have and its free in everyway. Plus it is much easier to read and teach with. I love it as does everyone who takes the course.

  11. Re:Its 20-30% faster !! by elflord · · Score: 4, Interesting
    If it were possible to compile Python (or any other interpreted language), would this make it anywhere near the speed of C/C++?

    Compiling alone wouldn't bridge the gap. Python already reduces interpreter overhead by using a pre-compiled byte-code. A large part of the problem is in dynamic typing: for example, when you say
    a+b
    in python, it's not equivalent to doing the same in C++. In python, you need to do a runtime type check and then decide what operation to perform, and only then can you add a and b. In C++, the dispatch can be performed compile-time.

    What you really need to get a big speedup is some sort of mechanism that can eliminate a lot of this type checking (the other guy posted a link to an interesting approach to this problem)

    But I've often been impressed with the ease of coding in such a language

    It's a bit of a two-edged sort for the same reason -- the lack of type checking makes it easy to write code quickly, but it also makes it easy to code incorrectly.

  12. Re:Whitespace trolling... by BigJimSlade · · Score: 4, Interesting
    What's wrong with { and }?

    What's wrong with it is that it's the syntax for dictionaries. Similar to hashes in Perl, it is a built-in type for Python. Anything wrapped in {} would probably be viewed as an attempt to make a dictionary by the parser.

    I've discussed this with all my software engineering colleagues, and most of them have white space as their only hang up about the language. I thought this was pretty petty at first, given the other strengths of the language, but one person brought up an extremely good point. A co-worker at his company is blind. He said that having to deal with white space while coding was near impossible (maybe he uses a "pretty printer" or code beautifier after the fact? I don't know) Has anybody on /. had experience with a blind user of Python? How did they work around this issue (if at all?)

    I do think it would be nice if there was a way to open and close a block (someone later down in the comments suggested preprocessor comments of
    #begin
    and
    #end
    ) such that one could use either method. Perhaps there would even be a built in function of the interpreter to spit out the code one way or the other.

    I must say I've gotten used to the whitespace over the past year. Using a decent editor makes life much easier in this respect. I would encourage anyone who hasn't tried out Python for this reason alone to give it a shot for a few weeks and see what you think.