Slashdot Mirror


The Evolution of Python 3

chromatic writes to tell us that O'Reilly has an interview with Guido van Rossum on the evolutionary process that gave us Python 3.0 and what is in store for the future. "I'd like to reiterate that at this point, it's a very personal choice to decide whether to use 3.0 or 2.6. You don't run the risk of being left behind by taking a conservative stance at this point. 2.6 will be just as well supported by the same group of core Python developers as 3.0. At the same time, we're also not sort of deemphasizing the importance and quality of 3.0. So if you are not held back by external requirements like dependencies on packages or third party software that hasn't been ported to 3.0 yet or working in an environment where everyone else is using another version. If you're learning Python for the first time, 3.0 is a great way to learn the language. There's a couple of things that trip over beginners have been removed."

14 of 215 comments (clear)

  1. Combine them.... by thetoadwarrior · · Score: 4, Funny

    and make everyone happy with Python 5.6

    1. Re:Combine them.... by Radish03 · · Score: 4, Funny

      Either that or he's a Winamp developer.

  2. Re:Roland Piquepaille: a case study in madness by Anonymous Coward · · Score: 4, Funny

    I don't think will be a problem any more

  3. Getting into Python 3 by dedazo · · Score: 4, Informative

    For those interested, IBM is running a primer series on the new language/runtime features.

    There's also this older (but still relevant) PEP that explains things that did not change between the 2.x series and 3.0.

    Personally, I'm not looking forward to migrating existing code bases (especially non-trivial ones) to 3.0, but I'm planning to do all new development against it (of course assuming that the various packages I use have ports).

    For Python trivia lovers, here the the actual moment in time when 3.0 was let loose on the world. I'm such a sentimental geek :)

    --
    Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
  4. Oh good. by powerlord · · Score: 4, Insightful

    There's a couple of things that trip over beginners have been removed.

    So whitespace block delineation is finally out, in favor of braces? :P

    --
    This space for rent. All reasonable inquiries will be entertained at proprietors discretion.
    1. Re:Oh good. by SatanicPuppy · · Score: 5, Insightful

      I'll preface this by saying that I program primarily in brace-based languages.

      Braces suck in the worst possible way as a method of delineation. Let me give an example:

      while(...){if(...){if(...){}elseif(...){}}}

      That's clearly the suck, so we break it out like:

      while(...){
          if(...){
                if(...){
                }elseif(...){}
          }
      }

      ...at which point we realize that the braces are basically useless, since the code is unreadable without the whitespace. Python just forces you to use a readable formatting, and it's not all that hard to get used to.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    2. Re:Oh good. by hwyhobo · · Score: 5, Insightful

      at which point we realize that the braces are basically useless, since the code is unreadable without the whitespace.

      No, it means the code is hard to read, but it still works. You can reformat that block, or you can change the spaces (tabs, number of spaces), and it will still work. In Python, it may look okay, and be readable, but it won't work.

      I guess it is a matter of priorities.

      BTW, I like Python (and have almost given up on Perl 6), but the white space thing drives me crazy.

      --
      End anonymous moderation and posting on /.
    3. Re:Oh good. by costas · · Score: 4, Insightful

      The whitespace issue is a red-herring: most people get used to it quickly and it's not as strict as it sounds (you can mix-and-match tabs and spaces, as long as you are consistent for each *block*; not even an entire .py file). There's two real-world problems with it: copy-and-paste and generating Python code. Both are much less common than looking at badly-formatted code that it takes a bit to mentally parse which brace-delineated languages have.

  5. Re:Trip over beginners? by lewp · · Score: 4, Funny

    Well, Common Lisp stole my bike.

    --
    Game... blouses.
  6. Re:Backwards Compatibility by ultrabot · · Score: 5, Interesting

    I think that whenever a group releases a new version of their language, they should strive to make it (mostly) backwards compatible.

    That's why they keep releasing 2.x versions that are backwards compatible.

    This means that very large projects have a lot of work to do to bring their project over to the new specification.

    Very large projects can stay with the 2.x series (along with a big portion of users) just fine.

    The question is: is this work worth the upgrade to python 3.0? I'd say on the whole, the changes do not contribute enough to the usability of the language to make it ultimately a worthwhile transition to make. I haven't seen really any compelling features in Python 3.0 that would provide enough incentive for me to spend hours of grunt work making all my code workable in Python 3.0.

    And you shouldn't, since it would probably be a waste of work. 2.x is a rock-solid series that is years away from obsolescense, and new serious projects started right now should pick 2.5 / 2.6. Try starting to use Py3 for projects where it fits - your command line scripts, self-contained internal applications... and ramp up the stakes when new libraries are ported.

    A programming language deserves a "cleanup" every now and then - this is such a thing. Hey, people have survived worse things, like gcc version changes, Qt3 => Qt4, Gtk 1 => Gtk2...

    --
    Save your wrists today - switch to Dvorak
  7. Re:In all seriousness by ultrabot · · Score: 5, Funny

    Yes.

    Example program:

    class MyClass(object): #{
            def myfunction(self, arg1, arg2): #{
                    for i in range(arg1): #{
                            print i
                    # whoops, forgot to close that bracket!
            #}
    #}

    --
    Save your wrists today - switch to Dvorak
  8. Re:In all seriousness by horza · · Score: 4, Insightful

    I've edited Python in vi, Notepad, SciTE, Geany, and other editors without any problem. Never used emacs though. If whitespace is causing bugs in your team's code you need to (a) introduce process or (b) lose some dead weight from your team. For (a) you can standardise on editor and whether to use tabs or spaces, or you can get the coders to end a whitespace block with a comment, eg # endif. I've only been using Python a couple of years but my experience so far suggests the problem is with you and not the language.

    Phillip.

  9. Re:In all seriousness by AlexMax2742 · · Score: 4, Informative
    --
    I'm the guy with the unpopular opinion
  10. Re:In all seriousness by SleepingWaterBear · · Score: 4, Insightful

    If he had said that it must be indented by exactly 1 tab or exactly 4 spaces or whatever other measure and everything else would throw a syntax error, it would have been fine. As it is I'd say about 15-20% of the time I spent doing Python was spent fixing these kinds of bugs.

    I have to assume that most of your time doing python has been spent copy/pasting code off the web. I've been coding python nearly daily for a couple years now. I've rarely made indentation errors, none in the last few months, and only once have I ever had an indentation error that took more than 10 seconds to debug. The thing is, most indentation errors are so visibly clear that it's really quite hard to make them.

    If you're actually having problems with multiple spaces looking like tabs, you can use the -t option to make it throw an error if you use a mixture of tabs and spaces, but it really shouldn't be that hard.