Slashdot Mirror


Python 3.0 To Be Backwards Incompatible

Stony Stevenson writes "Organizations using Python will be affected in a major way by changes in store for the language over the course of the next twelve months, Linux.conf.au attendees were told this morning. The Python development community is working towards a new, backwards-incompatible version of the language, version 3.0, which is slated for release in early 2009. Anthony Baxter, the release manager for Python and a senior software engineer at Google Australia, said "We are going to break pretty much all the code. Pretty much every program will need changes." Baxter also added another tidbit for attendees, saying that Python accounts for around 15 percent of Google's code base."

96 of 438 comments (clear)

  1. It's a race by Intron · · Score: 5, Insightful

    Will the new Perl or the new Python be the first to shoot itself in the foot with incompatibility?

    --
    Intron: the portion of DNA which expresses nothing useful.
    1. Re:It's a race by Anonymous Coward · · Score: 3, Informative

      Is Perl 6 backward-compatible with Perl 5?
      No.

    2. Re:It's a race by IkeTo · · Score: 4, Informative

      From Perl 6 FAQ (http://dev.perl.org/perl6/faq.html)

      > Will I be able to convert my Perl 5 programs to Perl 6?

      > Yes. Larry Wall and others are already working on a Perl 5 to Perl 6 translator, which will be able to translate (most) Perl 5 source code to the equivalent Perl 6 syntax.

      > In addition, Perl 6 will provide a "Perl 5 compatibility mode", allowing the compiler to directly execute any code that it recognizes as being written in Perl 5.

      Depending on who you talk to, this can be said to be backward compatible.

    3. Re:It's a race by misleb · · Score: 3, Interesting

      Yes.

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    4. Re:It's a race by hey! · · Score: 2, Insightful

      Neither has to.

      The question is, who is going to have the hardest time interfacing to existing code?

      In either case, things are changing that could present challenges to this. Perl is going to a new virtual machine. Python is changing things like string handling. Either one could he a show stopper when it comes to using existing code.

      Neither Perl 5 nor Python 2 is going away. Interfacing with existing code would be a huge boost to either Perl 6 or Python 3, but of the two, I think Python 3 is more likely to catch on even if it is incompatible. The reason is this: people use Python either for its lexical and syntactic simplicity, or because they want to build products for something like Zope. The Zope users won't touch Python 3 until Zope runs on it; afterwards they'll use whatever its available for. The people who use Python as a kind of "programming in pseudocode" language will adopt Python 3 if it looks cleaner.

      Perl, on the other hand, is about diversity. A Perl programmer working in a version of Perl that doesn't interface with Perl 5 is cut off from a big part of that diversity. At the very least, nearly everything in CPAN needs to be usable in Perl 6; but there are also countless systems built around mod-perl or even perl cgis. Perl is not, in my opinion, clearly superior to other scripting languages available today. What is uniquely valuable about Perl is the whole software ecosystem built around perl since the 1980s.

      I hope that "incompatible" only refers to source in both cases. It looks like the biggest headache for updating Perl 5 code to Perl 6 is going to be the fact that "@foo[0]" will be the first element of the array @foo which we'd write as "$foo[0]" in Perl 5. This kind of change shouldn't make it impossible to call Perl 5 routines from Perl 6. A lot of the Perl syntax and lexical changes seem to either be sugar, or to provide optional ways of making your code more easily optimizable. TFA doesn't say much about the new Python changes, but of the ones I've heard about, the only one that really is a show stopper is the change to unicode for all strings. It's a good thing, in my opinion, but if you want to call an older routine, the lack of formal parameter typing would mean you'd need to know to convert any strings to byte sequences.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    5. Re:It's a race by bcrowell · · Score: 2

      And what did that do to perl... Nothing good. Perl was once a really big language use for almost every app out there. Then by the time from the move to perl 6 the apps went away and more Python Apps starting appearing.
      Oh, please. How about not pontificating about things you have actually no clue about. Perl has never been used "for almost every app out there;" its niche has always been CGI and scripting. When you say "by the time from the move to perl 6," it sounds like you're unaware that there's not yet a full implementation of Perl 6. "...and more Python Apps starting appearing" -- you mean in the future, which you're a visitor from?

    6. Re:It's a race by yo_tuco · · Score: 2, Informative

      "I think Python has a small enough user base that they could actually pull it off."

      According to this index, anyway, Python has a respectable base and is slightly ahead of Perl. But, yeah, they could pull it off at this point.

    7. Re:It's a race by DragonWriter · · Score: 2, Insightful

      Depending on who you talk to, this can be said to be backward compatible.


      At least the first form of "backward compatibility" mentioned (a translator for most older code) is also available (or a planned feature) for Python 3.0.
    8. Re:It's a race by Incongruity · · Score: 5, Informative

      See, the funny thing is that the changes going into Python 3 are fixes for much of what people have complained about in Python 2.x and prior.

      Moreover, every step of the way they've built translators to move code from 2.x compatibility to 3.0 compatible -- and it'll catch when it can't translate the code and tell you as much. It seems pretty slick from everything I've seen. In many cases the fixes are ones you could easily do yourself in seconds with a good text editor. This will be a minor speed-bump for most users

      For more info, check out the recent Doctor Dobb's Journal interview (audio) with David Goodger -- it's about PyCon 2008, but it also covers Python 3 as well.

    9. Re:It's a race by cheater512 · · Score: 2, Informative

      Perl and Python are both open source so no marketing executives are involved. :)

    10. Re:It's a race by BOFHelsinki · · Score: 5, Funny

      15% of the google codebase consitutes a "small user base"? Why, yes. Google is a big user but still just one user. So if 15% of Google uses it, it's only 0.15 users. That's a very small user base. Even Mono has a larger user base (Miguel).

    11. Re:It's a race by chromatic · · Score: 2, Interesting

      No one has to fix bugs in Perl 5 besides a couple of people at ActiveState, which has customers. People work on Perl 5 because they want to. (I still send in patches occasionally, even if I spend most of my available time working on Parrot.)

    12. Re:It's a race by Intron · · Score: 3, Funny

      You could just ask python:

      >>>"python" > "perl"
      True

      Whereas if you ask perl:
      perl -e 'print "python" > "perl"'

      It remains silent, see?

      --
      Intron: the portion of DNA which expresses nothing useful.
    13. Re:It's a race by Ambidisastrous · · Score: 2, Insightful

      Think about what was happening in those two examples -- the whole language was ported to a new runtime that didn't even exist when the language was first designed, and VB's implementation was kludgey and brittle to begin with. Plus, Microsoft's motivation was more in pushing .NET than in winning new VB converts by showing a commitment to backward compatibility. And, it's Microsoft. C'mon.

      The number of concepts that change in Python 2.0 -> 3.0 is tiny. The main thing that will break everyone's code without the converter is that print changes from a statement to a function, so you need to parentheses everywhere. The rest is removing long-deprecated hacks, making Unicode the default, rearranging the library a bit, making module imports more explicit, and making built-in functions that returned lists instead return iterators, to save memory. All these changes have direct equivalents in the 2.x series. Some concepts are added, too, but that shouldn't be a problem for 2.x code.

      This all means that the converter will actually work. For VB, the best they could claim was that 90% of the port would be automatic; for Python's 2to3 conversion tool (included with the installation), it's expected that you can maintain a clean 2.6 codebase and automatically generate 3.0 code as needed until you're ready to switch to 3.0 full-time.

      Also, the plan for a backwards-incompatible Python 3.0 has been public for years. As if the incremented major version number wasn't a clue. Why the furor now? I don't recall seeing a story called "KDE4 introduces changes; Earth dying". A release manager made a flippant remark about compatibility, and a tech reporter sniffed blood, that's all.

  2. Just rename it. by Besna · · Score: 5, Interesting

    Call it "Cobra" or something. Too many kludges will confuse people. A new name and file extension will emphasize that this is "in with the new".

    1. Re:Just rename it. by Neil+Hodges · · Score: 5, Funny

      There are already other languages doing this. If you think naming closely-related languages the same thing is a kludge, what do you think of naming mostly-unrelated languages the same thing?

    2. Re:Just rename it. by Bogtha · · Score: 5, Informative

      The vast majority of the language and standard library will remain the same. This is just about tidying up some unfortunate warts that affect a lot of people, such as unifying the different string types. It remains Python in practically every way, and renaming it is simply unnecessary.

      --
      Bogtha Bogtha Bogtha
    3. Re:Just rename it. by Speare · · Score: 4, Funny

      Python's named after the troupe Monty Python, not after the snake species. I don't think renaming it is a good idea, but suitable successors would be [Life of] Brian, [Fish Called] Wanda, Flying Circus, Holy Grail or perhaps start with sub-versions like Cleese, Chapman and Palin.

      Alternatively, pick another troupe or favorite comedy show: Fry and Laurie, Mr. Bean, Fawlty Towers or Red Dwarf. Or my favorite, which brings back in the snake species AND British comedy into circular pun, Blackadder.

      While talking about puns, snakes and coming full circle, I suggest Ouroboros.

      --
      [ .sig file not found ]
    4. Re:Just rename it. by Anonymous Coward · · Score: 3, Funny
      > Otherwise, we'll be left with Python 1, Python 2, Cobra 1, Cobra 1.1, Cobra 1.3, Rattlesnake A, Rattlesnake SP1, Diamondback etc etc

      "THAT'S IT! I have had it with these muthafuckin' snakes on the covers of these muthafuckin' O'Reilly books!"
      - Guido L. Jackson.

    5. Re:Just rename it. by BrunoUsesBBEdit · · Score: 2, Informative
      Yikes don't do that because the choice of the name Python has nothing to do with Serpentes. It was chosen because of Monty Python's Flying Circus. So, the associations would be more like: Chapman, Idle, Gilliam, Jones, Cleese, Palin. Or it could be other comedy teams like: Mad, Saturday, Color, Hall, State, etc.

      Further more, if you don't already know that, why are you posting?

    6. Re:Just rename it. by morgan_greywolf · · Score: 2, Funny

      If you think naming closely-related languages the same thing is a kludge, what do you think of naming mostly-unrelated languages the same thing? You mean like VB.Net?

    7. Re:Just rename it. by orclevegam · · Score: 3, Informative

      Because whether or not it's a lie is largely a technical question that's somewhat open to interpretation. If by backwards compatible you mean is the old Perl5 syntax valid Perl6 syntax, then the answer is no. If however you mean will my old Perl5 scripts run in the Perl6 interpreter, then the answer is yes. Further more the old Perl5 modules (as per your link) will still be usable from Perl6, and there will be a converter to update the Perl5 scripts to Perl6 syntax. So, a better answer to the question of "Is Perl6 backwards compatible with Perl5?" might be "maybe".

      --
      Curiosity was framed, Ignorance killed the cat.
    8. Re:Just rename it. by orclevegam · · Score: 2, Funny

      In addition spam and parrot will now be reserved keywords. Much like goto in Java these will cause compiler errors and output the error messages "but I don't like spam!" and "Well, he's...he's, ah...probably pining for the fjords." respectively.

      --
      Curiosity was framed, Ignorance killed the cat.
    9. Re:Just rename it. by Tritoch · · Score: 5, Funny

      You could call it "Asp". Oh, wait...

    10. Re:Just rename it. by Ilan+Volow · · Score: 2, Funny

      Supervisor: 'Did you finish debugging your python scripts that update the database?'.

      Me: 'Yeah. They're ready to go, and they're all Fawlty now'.

      I think we better stick with "Python". Or "Smeghead".

      --
      Ergonomica Auctorita Illico!
    11. Re:Just rename it. by Kludge · · Score: 2, Interesting

      Too many kludges will confuse people. Yeah! Get lost all you wanna be's!

      Seriously, what really matters is:
      #!/usr/bin/python2
      or
      #!/usr/bin/python3

      And I'm betting someone will come up with
      #!/usr/bin/python
      that will automatically determine which python it is from the syntax.
  3. Another Shock Story by LowSNR · · Score: 5, Informative

    If the editors read the article rather than posting shock stories, Python 2.6 will also be released at the same time and will not break backwards compatibility. Python is not pulling the rug out from under its developers as the summary would lead you to believe.

    1. Re:Another Shock Story by betterunixthanunix · · Score: 4, Interesting
      No, but that means that everyone planning to run non-Python3 code will have to maintain two parallel Python installations. With package management that's not so bad, but it still puts a bit of pain on distro maintainers.

      Yet everyone makes fun of me when I say that I am a C++ programmer.

      --
      Palm trees and 8
    2. Re:Another Shock Story by onion2k · · Score: 5, Interesting

      It is an issue though. PHP did exactly the same between version 4 and 5, and it crippled adoption of 5 because hosts refused to upgrade as it'd have broken too much code. It was a full 3 years or so before 5 was really considered the primary version amongst many developers and that took the announcement of 4.x support ending and the success of the GoPHP5 campaign.

      Hopefully the Python team will learn from PHP's experience.

    3. Re:Another Shock Story by Schraegstrichpunkt · · Score: 2, Funny

      No, but that means that everyone planning to run non-Python3 code will have to maintain two parallel Python installations. With package management that's not so bad, but it still puts a bit of pain on distro maintainers.

      This is already done in the distros I've seen.

    4. Re:Another Shock Story by Bogtha · · Score: 2, Informative

      It's been a lot longer than two years. For example, see this thread from eight years ago:

      The new release schedule provides for a 1.7 release later in 2000 (or early 2001); after that, we'll be working on "Python 3000" (the new code name for the grand Python redesign; the language will be incompatible).

      And from a reply:

      (personally, I'd be very surprised if the changes were such that old code couldn't be automatically translated).

      --
      Bogtha Bogtha Bogtha
    5. Re:Another Shock Story by misleb · · Score: 2, Insightful

      It is an issue though. PHP did exactly the same between version 4 and 5, and it crippled adoption of 5 because hosts refused to upgrade as it'd have broken too much code


      Not a big issue for Python, methinks. Python is not generally used in hosted environments like PHP is. At least not in the same proportion. PHP's only real strength is its install base. You can get it on just about any host. To make a comparison outside of languages, PHP is like WIndows. The major selling point is its ubiquity. In which case, compatibility with the rest of the install base becomes first priority. Python's strength, on the other hand, is Python.

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    6. Re:Another Shock Story by Eli_Courtwright · · Score: 2, Informative

      The Python dev team knows that it will take years for Python 3.0 to be considered the default for most people; they've said as much on their mailing list. That's one of the main reasons why they're backporting as many features as they can to the 2.6 release - basically everything that doesn't break backwards compatibility.

    7. Re:Another Shock Story by pthisis · · Score: 4, Informative

      Python2.5 and later let you write 3.0-compatible code. Just put parens around your print statements and you're probably fine to run in 2.5, 2.6, or 3.0. There are a few other changes which 2to3 and the 2.6 interpreter will warn about, but they're relatively rare. e.g. range will return an iterator instead of a list; code like:

      for i in range(1000):
              # do something

      will remain unaffected, but code that does something like:

      a=range(1000)
      a[37] = 2000
      for i in a:
            # do something

      will be affected.

      The conversion tool and 2.6 interpreter will warn you about those things, and they're easy to fix ( "a=list(range(1000))" ) if 2to3 doesn't do them automatically. Which I'm not sure about, because they're highly unusual--2to3 has converted all of my personal code just fine.

      --
      rage, rage against the dying of the light
  4. Workaround... by fahrbot-bot · · Score: 5, Funny
    I think I have a Perl script that'll fix this...

    Just kidding Python fanbois :-)
    Chill, it's Friday.

    --
    It must have been something you assimilated. . . .
    1. Re:Workaround... by tuffy · · Score: 5, Informative

      Actually, Python2.6 is slated to include a tool which will update purely syntactic differences to Python 3 automatically. There are some issues it won't be able to fix, but Python2.6 will have a mode which will generate warnings about those so that they can be fixed well before Python 3's release.

      --

      Ita erat quando hic adveni.

  5. print as function vs. keyword by spookymonster · · Score: 5, Informative

    The biggest incompatibility is how you output to stdout. Instead of doing

        print "This used to work"

    You now have to do

        print("This is how 3.0 rolls")

    There will be no grandfathering, so everything needs to be refactored accordingly.

    A small, but significant change.

    --
    - Despite popular opinion, I am not perfect.
    1. Re:print as function vs. keyword by Bogtha · · Score: 4, Informative

      Actually, the migration tool 2to3 performs this change automatically, and the function call approach works in both 2.5 and 3.0, so the incompatibility is greatly exaggerated.

      --
      Bogtha Bogtha Bogtha
    2. Re:print as function vs. keyword by Wiseman1024 · · Score: 3, Interesting

      A good one though. Statements are stupid. Probably Python's biggest flaw. It's good that they're getting rid of a couple of them, though while, if and the like still remain.

      If you're wondering why statements are stupid: they are not first class values you can pass, use and manipulate; they introduce a special, harder to learn and very quirky syntax; they cannot be used anywhere and thus subtract flexibility; and they are an extra form or feature that's actually unnecessary ("Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary." - R6RS, Introduction, best piece of insight on software design ever).

      The difference between print >>lol, wtf and print(wtf, file=lol) is that, in the later case, print is a first-class value (a function, in this case) that I can pass to another function should I need it to call it back, or use in the middle of an expression.

      --
      I was about to say 13256278887989457651018865901401704640, but it appears this number is private property.
  6. I don't see the problem by Urger · · Score: 5, Insightful

    While it would be nice if it were otherwise, sometimes you need to break with the past to develop solutions to problems. It's an ugly, but very real truth. Thats not to say that my I will be rewriting my code to 3.0 immediately, but sometime in the next year or two I probably will.

    1. Re:I don't see the problem by Jugalator · · Score: 2, Informative

      I agree. If you keep not trying to break things, the end result can easily be worse than if you dare to do.

      Yes, there's the inevitable scary transition period with backwards incompatible upgrades, but after that's done, you'll be ready to reap the rewards.

      I can't for example not thank Microsoft enough for making my life with Visual Basic code (yes, I have to deal with that occasionally in my job) far easier when they scrapped Visual Basic 6 and made something that must have been hundreds of incompatible changes to the language in Visual Basic 7 / .NET and onwards. The reward was a full fledged object oriented language that can barely even be compared with its hack job to a predecessor.

      Granted, the difference will surely not be as great here, but this will most likely also mean that the transition will not be nearly as harsh either.

      --
      Beware: In C++, your friends can see your privates!
  7. We have options. by Sludge · · Score: 4, Insightful

    I maintain tens of thousands of lines of Python... and I'm not worried. Why? Because I am sure they will continue to support security and bugs on the 2.x line for a long time to come.

    It is not like your favourite Linux distro is just going to drop the 2.x series overnight, or like Python 3 will fight 2.x on your system.

  8. Whiners by MikeDataLink · · Score: 5, Insightful

    We whine when companies break compatability, yet we whine just as loud about bloated software when companies leave in compatibility.

    Tell, me exactly what would satisfy you? How about we just take your computer away.

    I'm running for president! FREE PACIFIERS to all Slashdotters. ;-)

    --
    Mike @ The Geek Pub. Let's Make Stuff!
    1. Re:Whiners by Sciros · · Score: 3, Funny

      What color?

      --
      I like basketball!!1!
    2. Re:Whiners by sayfawa · · Score: 2, Insightful

      We whine when companies break compatability, yet we whine just as loud about bloated software when companies leave in compatibility.

      Tell, me exactly what would satisfy you?


      There's an obvious and simple solution that these stupid developers could implement if they weren't so lazy. As soon as they are done with the new backwards-incompatible code base they should just go back in time, preferably before I ever learned any code, and release it then. That way, all of the Python code I've written would have been 3.0 compatible from the start.

      --
      Free the Quark 3 from asymptotic confinement! Bring your charm! Don't get down! All colours and flavours welcome!
    3. Re:Whiners by 19thNervousBreakdown · · Score: 5, Funny

      It's almost like there's more than one person with an opinion on this!

      --
      <xml><I><am><so><damn>Web 2.0</damn></so></am></I></xml>
  9. meh by seanyboy · · Score: 4, Insightful

    As long as you can run Python 2 & 3 in the same environment, this shouldn't be a big deal.
    It'll just be a case of slowly moving code from one version to the next.

    This is a brave move, but you've only got to see the mess you can get into trying to force backward compatibility for too long (Vista, anyone) to know it's the right move.

    Of course, this being python, I fully expect some brainbox to come up with an automated conversion routine (v2 to v3) that "WAS WRITTEN IN ONLY 15 LINES OF CODE". etc, etc.

    --
    Training monkeys for world domination since 1439
  10. Python is doomed by Arthur+B. · · Score: 5, Funny

    Look at C++, they broke backwards compatibility with C ( malloc casting for example ) and because of that it never became mainstream.

    --
    \u262D = \u5350
  11. Almost 2 years old? by Anonymous Coward · · Score: 5, Informative
    People only reading the summary and shooting from the hip should realize:
    • Python 3 (or Python 3000 as it was called) as a serious effort is more than a year old.
    • There is already a working interpreter in its second alpha release.
    • Final release is slated for August. (No infinite Perl 6 development.)
    • Developers are working very hard to make the 2 to 3 transition as painless as possible.
    • The Python team is committed to keeping the 2.x series going until 3.x has clearly been accepted.
    You may now proceed to complain having been thus informed. :)
  12. For more info, check out by spookymonster · · Score: 4, Informative

    The "What's New for 3.0?" article over on python.org:

    http://docs.python.org/dev/3.0/whatsnew/3.0.html

    --
    - Despite popular opinion, I am not perfect.
  13. Not news in any way by Bogtha · · Score: 4, Informative

    This has been known for donkey's years. Guido has been talking about this compatibility break since the 90s. The changes were laid out in detail in PEP 3000, first published in 2006. They have already released two alphas. A conversion tool to automatically make some of the required changes (such as changing print statements to print() function calls) already exists.

    --
    Bogtha Bogtha Bogtha
  14. philosophy by bcrowell · · Score: 2, Insightful

    IIRC, even dot-releases of python are not source-compatible. I assume that's why my install of Ubuntu has multiple versions of every library, e.g., /usr/lib/python2.4/smtplib.py and /usr/lib/python2.5/smtplib.py.

    I think this is partly a matter of philosophy. The people in charge of a particular language tend to be computer language enthusiasts, and they like to tinker with them. They say things like, "The language has to be able to continue to evolve, or else it will die," or "We don't want to lock in things that, in retrospect, were really mistakes." But people actually using the language typically put a higher priority on not having their code break. Obviously we wouldn't all want to still be writing old-style fortran, with fixed columns, Hollerith codes, etc., but I also don't agree with the philosophy that "bit rot" is inevitable, and every piece of code you write is like a baby that you have to tend for the rest of your life. Personally, one of the things I really like about Perl is that it's got an excellent, mature implementation, and it's been mature for a long time. This is a lot less true for Ruby, for example, in my experience. It's true that Perl 6 is going to break backward compatibility with Perl 5, but the Perl 6 interpreter is going to automatically recognize Perl 5 code, and handle it correctly.

  15. If this is news to you by pembo13 · · Score: 4, Insightful

    && you use python, please turn in your developer card

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
  16. in fact, such a utility already exists by Reality+Master+201 · · Score: 5, Informative

    http://svn.python.org/view/sandbox/trunk/2to3/

    And, as others have stated, there'll be the 2.6 branch, which will be backwards compatible.

    Or, in other words, the story is stupid and misleading.

  17. Re:So, will it FINALLY have block structures? by pembo13 · · Score: 2

    if it does, then it will be pointless. I like the whitespace thank you very much.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
  18. The Microsoft route by mariox19 · · Score: 4, Insightful

    Exactly! Now they can force people to buy expensive IDE's and servers to run the new version of Python, and strong-arm people into purchasing licenses to use the language for commercial purposes. It's just a money making ploy.

    Oh, wait a minute. All the old versions are going to continue to be available -- even the source code. And it will remain free for commercial use. Hmmmm.

    Sorry, but I fail to see how what they are doing is at all like Microsoft.

    --

    quiquid id est, timeo puellas et oscula dantes.

  19. Re:Damn right by maxume · · Score: 2, Informative

    So put #!/usr/bin/python2.6 or whatever in your scripts and don't worry about it for 5 years(probably much longer, due to the significant changes, 2.6 will probably last nearly forever, or at least until basically nobody is using it anywhere).

    Or does Ubuntu launch things based on file extensions?

    --
    Nerd rage is the funniest rage.
  20. It does have block statements. by Virak · · Score: 2, Funny

    They're just delimited with indentation instead of braces. And it's not the language that is stupid, it's you, because you are apparently not indenting your code at all, or you'd realize that indented code in other languages "Fs up" (you do realize you can say "fuck" on Slashdot, right? Watch: Fuck, fuck, fuck, fuck. It's pretty cool.) stuff just as much as indented Python code does. Any decent editor can automatically indent code for you in any language, and in this case Python is even easier because all it uses is the indentation, so you don't have to manually add additional delimiters in the appropriate places; just indent as usual. Copying and pasting code in any language requires you to reindent it just as much as with Python, lest it become an unreadable mess, and again, any decent editor provides the ability to adjust the indentation of whole blocks of text with ease. And if you find yourself utterly stumped by the challenge of generating properly indented code, you simply should not be programming.

    1. Re:It does have block statements. by Fweeky · · Score: 2, Interesting

      Copying and pasting code in any language requires you to reindent it just as much as with Python, lest it become an unreadable mess, Except with delimiters I can just type gg=G and I'm pretty much done.
    2. Re:It does have block statements. by DragonWriter · · Score: 2, Informative

      Any decent editor can automatically indent code for you in any language,


      Wrong. Any decent editor can automatically indent code for you in any langauge where the proper indentation can be unambiguously defined by applying a series of rules to some other set of constructs in the language. This works for any language that has an unambiguous block structure even in the absence of any significance given to different whitespace patterns, which is true of lots and lots of languages, but, notably, not Python.

      Because the interpretation of the block structure of Python relies on indentation, a Python editor can't automatically indent properly. Sure, as you are typing, it can give you a guess at where you might want to indent the next line that you only have to shift-tab or tab to get to where you do want it (and it can automatically handle tab->space conversion, etc.), but it can't automatically indent code that isn't already indented properly.

      and in this case Python is even easier because all it uses is the indentation, so you don't have to manually add additional delimiters in the appropriate places;
      just indent as usual.


      In a language with structure that is unambiguous before considering the detail of whitespace patterns (e.g., Lisp) and a decent editor, there is no "indent as usual". You just enter delimiters. When you feel like breaking a line, you do so. Your editor indents exactly right every time with no intervention. The only time you need to do anything manually to indent is after a cut and past operations, or after manually doing something that destroys the existing indentation for some reason, and all you need to do then is to tell your editor to automatically indent the line or region of code, and your are back to okay.

      So, no, Python doesn't take away the need for delimiters and keep the same burden on indentation, it trades the burden of putting in and preserving the right delimiters for the burden of putting in and preserving the right indentation.

      Copying and pasting code in any language requires you to reindent it just as much as with Python, lest it become an unreadable mess,


      Copying and pasting code in a language that is structurally unambiguous before considering indentation, using a decent editor, requires telling the editor to automatically indent the block of pasted-in code. Usually that's selecting the code and and then hitting one keyboard shortcut. (Conceptually, an editor could be configured to automatically indent on an paste operation, but I don't immediately recall any that are by default.)

      Copying and pasting code in a language where block structure is indicated by indentation alone usually requires selecting the code and then manually adding or deleting the right number of indentation steps to match the intended meaning of the code. This isn't a lot more burdensome, but it is clearly at least slightly more burdensome.
  21. Re:#1 way to prevent adoption of new language vers by Llywelyn · · Score: 4, Informative

    Relax.

    First of all, the changes are mostly simplifications to the core language (e.g., how to catch exceptions is currently a bit of a mess if you want to catch more than one exception). So for example, range and xrange are now one, iterators become more prevalent, "old-style" classes are going away and so new-style ones will become the standard, a lot of the things that have been deprecated now are being removed, etc. It isn't really a "new language" in any sense. This is far superior to Java's "always backwards compatible" approach which has lead to a lot of cruft building up over the years.

    Next, it needs to be understood that 2.6 will be backwards compatible and include a warnings mode to highlight things that won't work in Python 3.0 to ease in the transition. There should be no problem supporting both on one system.

    Finally, they are providing a 2.5->3.0 translation tool that runs in 2.5 and does most of the mechanical translation between the two for you.

    --
    Integrate Keynote and LaTeX
  22. Re:Sad day by LaughingCoder · · Score: 2, Insightful

    You can slam Microsoft for a lot of things, but breaking backwards compatibility (B.C.) would be far, far down on that list. They bend over backwards (no pun intended) to maintain B.C. In fact, that compatibility oftentimes is the source of their security woes. And it is most certainly one of the major causes of code bloat, and buggy code. Personally, I think Microsoft should consider *reducing* their emphasis on B.C. in order to improve those other attributes I mentioned.

    --
    The more you regulate a company, the worse its products become.
  23. Python takes a step backwards. by Animats · · Score: 2, Informative

    There's surprisingly little in Python 3.x that's really needed, and much that isn't. The approach to parameter typing (optional and unenforced) is silly. Having it and not enforcing it is just asking for trouble.

    It probably would have been more productive to standardize on 2.6 and get a formal standard out the door, instead of using the CPython implementation as the standard. With a formal standard that couldn't be casually changed, the other implementations, all of which are faster than CPython, would have a firm target to implement. Python is twenty years old, and there still aren't multiple, compatible implementations.

    Python could be a much higher performance language. Take a look at the Shed Skin implementation. One guy is trying to implement a hard-code compiler for Python that does type inference to determine types at compile time whenever possible. That yields a 10x-30x speedup. If you have rackmount servers running Python, that's a big win - one rack instead of ten.

    Python has some optimization gotchas that really should be fixed. The big problem is "undetectable dynamism", or "if the only tool you have is a dictionary, everything looks like a hash". It's rare to store into a local variable of a function, or modify a method of a class from the outside of the class. Most classes don't have attributes added to them after creation. Python allows all these things, which can occasionally be useful. The trouble is that it's really tough to tell at compile time if the hard cases are going to be needed, and thus code has to be pessimized for the worst case.

    This could be fixed with a few restrictions:

    • Classes which can be dynamically modified from outside themselves should be subclasses of "dynamicobject" instead of "object". This makes everything dynamic but reduces performance. For most objects, the compiler can then find all the variables during compilation, assign them fixed slots, and avoid having a dictionary in each object. If an object indulges in self-modification or attribute creation, the compiler can see that at compile time and generate the slow code for the hard case. This is only needed for objects which are patched from outside themselves, something the compiler can't now detect and needs to know about.
    • Variables cannot change major type during execution. If a variable is initialized with an integer or float value, it cannot thereafter be changed to an object type. Shed Skin imposes this restriction, which means it doesn't have to "box" numbers in objects and can hard-compile arithmetic.
    This would make it possible to boost Python performance up to the Java level, and get it within striking distance of C/C++, yet not require declarations.
  24. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 4, Insightful

    Indentation is a derived piece of structure, but should never have semantic meaning in a language except as a separator.

    Why, exactly, is it that it should never have semantic meaning? Is there a rule somewhere?

  25. Shocking! by smallpaul · · Score: 2, Funny

    Guido is following through on the plans he announced years ago! Let's all discuss it as if it were amazingly novel news!

  26. Re:So, will it FINALLY have block structures? by timster · · Score: 2, Insightful

    Using two separate mechanisms to denote structure -- curly braces with the real meaning, and indentation as an alleged re-creation of what the curly braces indicate -- also asks for problems. Many people find the whitespace problems less troublesome than the curly-brace problems. Pretending that either solution is perfect is plain nonsense. The Python solution is not hard to use or understand.

    I find that your criticism falls at a surprisingly shallow level of thinking. You would think that someone familiar with Lisp would be able to see beyond the first layer of a language and recognize that the strength or weakness of Python has little to do with syntax details that take five minutes to accept. The simplicity, flexibility, and overall utility of a language's cognitive model is more important, and it seems like whining about syntax is little more than noise in an important debate. Yet for some reason, the use of whitespace in Python inspires an obsessive response from people who happily ignore the (debatably worse) syntax crimes of Perl, Ruby, or C++.

    --
    I have seen the future, and it is inconvenient.
  27. Breaking backwards comp. in languages good by Crazy+Taco · · Score: 5, Interesting

    Will the new Perl or the new Python be the first to shoot itself in the foot with incompatibility?

    You know, sometimes a little backward incompatibility can be good. You can shoot yourself in the foot more by not breaking things when something needs fixing. As an example I point to VB.Net.

    Back in the days of VB 6 and prior, VB was an entry sort of language that was designed with novice programmers in mind, and strayed quite a bit from normal programming constructs. With the advent of the .Net platform looming, Microsoft wanted to move VB to .Net, but didn't want to break existing code out in businesses. So they opted instead for kludges and workarounds in the language, and that's the reason I can't wait to get done with VB .Net project I am currently writing. If you are an experienced programmer in other languages such as Java, C++, etc, VB .Net can drive you mad. Here are just a couple examples:

    1. Arrays. VB did not originally have 0 based arrays. Its arrays started at 1. In order to get VB to work with .Net, Microsoft really turned arrays into a kludge that is very difficult to remember (I almost always have to pull out an O'Reilly reference) and easy to get wrong. In a normal language, you declare an array of five integers and you get five slots numbered 0 through 4, right? Well not VB .NET! You declare an array of five integers, and you get SIX slots, numbered 0 through 5. And where most languages you would see "something - 1" when referencing array locations, in VB you often see "something - 2"! That really makes things annoying, especially if you've worked in .NET before with C#, because when you come over to VB you are almost guaranteed to biff things up.
    2. Logical operators. In the original VB, "And" and "Or" operators did NOT do short circuit evaluation. To avoid breaking code, Microsoft introduced even more operators, "AndAlso" and "OrElse". Those two operators are just like "And" and "Or" except that they do do short circuit evaluation, but good luck trying to remember to use them when coding quickly. I know when I code and want to "And" things together, I think "X And Y", not "X AndAlso Y". Therefore, these new kludge operators certainly aren't the default operators most people think to use, so most end up using "And" and "Or" in the heat of coding, and VB code suffers and unecessary performance hit all over because short circuit evaluation isn't often used.

    There are many other examples in VB like this, so I say this to the Python developers: If you have a good reason to break backwards compatibility with the language, then do it. Keep backwards compatibility whenever reasonably possible, but break it before accepting a kludge into your language. Your future coders will thank you, and will not run away screaming to the other, newer languages that will inevitably follow.

    --
    Beware of bugs in the above code; I have only proved it correct, not tried it.
    1. Re:Breaking backwards comp. in languages good by thejeffer · · Score: 2, Informative

      1. When you declare the array, you pass the upper bound of the array, not the length. Take two seconds to read the language syntax, and it clearly states this. These are zero-based arrays, so the upper bound of an array of 5 elements would be 4. No, it's not the same as Java or C++, but that's because it's NOT Java or C++ style syntax. If you want that, use C#. As far as your claim of "something - 2" being all over the place, I've never once used anything like that, and I've also never seen it in use. There'd be no reason for it. Arrays are zero-based, just like most other common languages, so just like them, you'll still use "something - 1". Don't blame poor code on the language. Blame it on the poor programmer.

      2. Once again, this is a problem with poor programmers, not the language. "And" and "Or" are the bitwise operators, equivalent to C#'s "&" and "|". "AndAlso" and "OrElse" are the logical operators, equivalent to "&&" and "||". I fail to see how the difference between "&" and "&&" is magically clearer than the difference between "And" and "AndAlso". If you can't remember the difference, than print up a cheat sheet.

      By no means am I claiming VB.Net is perfect, because it definitely has some kludges, but at least pick legitimate ones.

    2. Re:Breaking backwards comp. in languages good by I'm+Don+Giovanni · · Score: 2, Insightful

      "AndAlso" and "OrElse" are used by other languages such as SML, so it's not like some horrible thing that only Microsoft uses.

      --
      -- "I never gave these stories much credence." - HAL 9000
    3. Re:Breaking backwards comp. in languages good by the-matt-mobile · · Score: 2, Informative

      Preach it Crazy Taco! My biggest annoyances with VB.NET are the things they kept around just to make the VB6 devs feel more comfortable. Such as:

      1.) "Dim"? Why the heck did they keep the "Dim" keyword!?

      2.) When you see "SomeRandomlyNamedThing(7)", is that a method call or an array index? Why on earth did Microsoft keep parens as the array indexer?

      3.) Option Strict is off by default.

      4.) "&" for string concatenation!? I guess when you leave Option Strict Off, it's required, but blech!

      5.) You can't stop people from using Left(), Right(), Mid() and other legacy functions because you have to include the Microsoft.VisualBasic in order to get vbCrLf and vbTab. Otherwise your code would be filled with Char(10), Char(13), and Char(9) all over the place.

      6.) It's still a second class language to C#. No Yield keyword and no ++ and -- operators.

      7.) Modules. Blech. Just let people get used to the idea of static classes instead of trying to make an OO language look like a functional one.

      8.) Microsoft thinks VB devs are way too dumb to get namespaces so they try to hide them. Why on earth don't namespaces follow the directory structure of the source files by default? This is a killer when using embedded resources (which is a handy alternative to hard-coded SQL strings).

      9.) Why oh why do I have to have 'Sub's. Why can't a 'Sub' just be a 'Function' with a void return type?

      10.) Why do I have to tell VB what I'm "End"ing? "End For", "End Function", "End If" - wouldn't "End" be sufficient and then you could put a comment if you really cared what you were ending?

      I could go on and on. The worst part is - since VB.NET broke compatibility with VB6, why didn't Microsoft just go the rest of the way and make the language better? They stopped short. This, I hope, is not the fate of Python. There are many ways to make the language better (white space agnostic option perhaps?), so I hope they don't waste their decision to break compatibility by leaving purposeless annoyances like Microsoft did with VB.

    4. Re:Breaking backwards comp. in languages good by Doctor+Faustus · · Score: 4, Informative

      Its arrays started at 1. In order to get VB to work with .Net
      This was actually introduced prior to .Net. I'm not sure when, exactly, but VB6 is the same way. Actually, VB6 is pretty schizophrenic about 0 vs. 1 based indexes in general. I used to make a habit of just putting in a breakpoint and looking at the array while the program ran, instead of trying to remember which was which.

      Personally, I like the way Turbo Pascal made you declare both upper and lower bounds. 0-based arrays make sense in a systems programming language when it's just a thin veneer for a pointer, but VB, C# and Java shouldn't force it on you.

      In the original VB, "And" and "Or" operators did NOT do short circuit evaluation.
      Beyond that, they were bitwise operators, not logical. The fact that 1 is true, 2 is true, but 1 AND 2 is false is far more perverse than the lack of short-circuiting. This is also why the canonical true value in VB is -1 (1111111111111111 binary) rather than the usual 1. This was appropriate in Bill G's 8K Altair BASIC, but it should have been fixed in MS BASIC well before 1980.

      VB.Net Beta 1 made "And" and "Or" normal logical operators and introduced new bitwise operators for the old functionality, but too many people complained and they switched it back for Beta 2.

      There are many other examples in VB like this
      I don't know about that. Those are pretty much the worst parts that .Net didn't fix. There are some clunky IO libraries clearly designed to be used by the migration wizard, but they're strictly optional. Plus, I really like that VB.Net still has real optional arguments, as opposed to C# that goes the Java route and makes you declare a little stub version with fewer arguments that just calls the real one and fills in a default value.

    5. Re:Breaking backwards comp. in languages good by shutdown+-p+now · · Score: 2, Informative

      Arrays. VB did not originally have 0 based arrays. Its arrays started at 1.
      This is false. Arrays in all versions of VB were 0-based by default, as they were in all prior Microsoft dialects of BASIC, and as they were in the original BASIC interpreter. It always worked that way in BASIC: "DIM a%(10)" got you an array of 11 integers, with indices from 0 to 10. A QBasic extension to that which made its way into VB was the ability to define the lower bound explicitly, similar to Pascal. So you could write "DIM a%(1 TO 10)" in VB, and indeed most people did that for the sake of convenience. Alternatively, one could use "Option Base 1" to change the default lower bound in the scope of a single module. VB.Net only got rid of that ability to expicitly define the lower bound for the sake of efficiency and CLS compliance (non-0-based arrays are possible in .NET, just much less efficient than 0-based).

      Logical operators. In the original VB, "And" and "Or" operators did NOT do short circuit evaluation. To avoid breaking code, Microsoft introduced even more operators, "AndAlso" and "OrElse". Those two operators are just like "And" and "Or" except that they do do short circuit evaluation, but good luck trying to remember to use them when coding quickly. I know when I code and want to "And" things together, I think "X And Y", not "X AndAlso Y".
      The default form of boolean operators is a matter of preference. FYI, the OrElse/AndAlso operators come from Ada (only there the latter is "and then"). The rationale is that, in an imperative language, short-circuiting behavior is surprising since it results in a silent omission of side effects of an expression. What's worse, it happens under some runtime conditions but not under others. If a developer misses it, he can get the code that works 99% of the time (when only the left operand is evaluated), and fails 1% of the time (when right operand has to be evaluated, and its side effects cause a bug). Therefore, making it a default is dangerous. On the other hand, non-short-circuiting operators, while potentially less efficient, at least display consistent behavior. Also, if expressions on both sides are trivial enough (e.g. inlined function calls), the compiler can verify the lack of side-effects, and short-circuit the operator where it is safe. In the worst case, you pay for less obscure bugs with a relatively small perfomance penalty.

      Of course, C/C++ and its derivatives with short-circuiting by default have changed the landscape so much that today such behavior is expected by the majority of programmers, so perhaps the rationale is no longer as valid as its used to be (though one can argue that unexpected but consistent behavior is still better than expected but inconsistent).

    6. Re:Breaking backwards comp. in languages good by Sigma+7 · · Score: 2, Informative

      10.) Why do I have to tell VB what I'm "End"ing? "End For", "End Function", "End If" - wouldn't "End" be sufficient and then you could put a comment if you really cared what you were ending? "End" is a keyword for termininating the application, and was like that since basic was invented. END IF and the likes were added when Basic was modified to use free-form code rather than sticking by line numbers that were in increments of 10.

      You could do fancy things with NEXT in line number format, including violating the now common programming practices. After implementing blocked statements, you need to specify what you are ending in order to avoid a broken or mismatched FOR or IF block. As long as you remember that BASIC is a basic programming language for inexperienced people, you'll understand this.

    7. Re:Breaking backwards comp. in languages good by the-matt-mobile · · Score: 2, Insightful

      Very interesting. I seem to remember that now that you mention it. But, in line with my original point - VB.NET has changed so drastically from it's ancestor that keeping these obscure vestigial artifacts makes the language feel kludgy. The solitary "End" could have been recommissioned to close the current block, since a standalone "End" has been relegated to obscurity. Perhaps "End Program" would have worked too. I guess it probably doesn't matter and ranks lower than some of the others on my list of annoyances, but this is slashdot - Microsoft gripes abound.

  28. Re:Damn right by pthisis · · Score: 5, Informative

    1. Python 2.6 is still due out and will be supported for years.
    2. Python 3.0 includes a 2to3 script to convert existing Python code to Python 3
    3. The incompatibilities are mostly mechanical, by far the largest is the change of "print" from a statement to a function (which simplifies the implementation and makes converting existing programs to log to files or whatever much easier). I've yet to find any of my code that 2to3 doesn't handle just fine.

    --
    rage, rage against the dying of the light
  29. Re:Smartass C programmer says... by Valdrax · · Score: 2, Funny

    Python already has C-style string formatting in the form of the % operator.

    i.e. print "%03d %03d" % ( num1, num2 )
    or, using a hash, print "%(foo)03d %(bar)03d" % { 'foo': num1, 'bar': num2, 'baz': num3 }

    So, what exactly is Python missing here, oh wise and mighty smartass C programmer?

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
  30. It's not like this is the first time. by Valdrax · · Score: 2, Informative

    I mean, am I the only one who's been using Python since at least 1.5.2? The made major changes between that version and 2.0 that broke almost all of our 1.5.2 scripts (particularly in the way they handled regular expressions).

    I didn't kill Python then, and it didn't stop us from using 1.5.2 for years to come for our old scripts and 2.x for our newer scripts.

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
    1. Re:It's not like this is the first time. by rk · · Score: 2, Interesting

      You're not alone! I started with Python 8 years ago using 1.5.2 as well. I liked python then, but when python 2 came out, I went from liking python to it becoming a favorite language. I looked at one of my old python 1.5.2 scripts a couple weeks ago, and it looked very odd and a little clunky to me. If python 3 someday makes me look at my python 2 code in the same way, then as far as I'm concerned, it's all good.

    2. Re:It's not like this is the first time. by slackergod · · Score: 4, Informative

      Indeed. You should read up on the changes they're planning to make.
      Many of them are backwards-incompatible changes that will remove nasty warts,
      realign certain parts of python's object structure (str vs unicode, int vs long)
      in ways that are MUCH cleaner, MUCH harder to make mistakes with, etc.

      This is not some Larry Wall day dream revision...
      they aren't rethinking python from the ground up,
      it's an evolutionary revision which is keeping the python 2.x codebase,
      but changing some things they've been wanting to do for a long long time.
      The 1.x -> 2.x transition is apt... the code will look almost the same,
      only cleaner :)

      If that's not good enough for anyone, automated tools are being developed
      to convert python 2.6 -> 3.0. Yes, that's right, Python 2.6. It'll
      be the last version of 2.x released, and be carefully designed to be
      both compatible w/ 2.x, and still able to warn you about gotcha's
      that would appear if you ran the code under 3.0.

      Not only that, but 3.0 isn't projected to be in mainstream use
      for at least 2 more years.

      There's absolutely no need for the sensationalist panic this slashdot headline
      annouced itself with. Rethinking a complex system from the ground up is always
      a bad idea... but GVR knows that, and that's not whats happening here.

      It's more akin to the linux kernel moving from 2.4 -> 2.6
      Incompatible, yes, but a much better architecture.

  31. If you develop in python by Anonymous Coward · · Score: 2, Funny

    and you use && instead of 'and', please try to forget your C background.

  32. Much like python's approach by CarpetShark · · Score: 2, Insightful

    Yes, some kind of transition phase is the only approach that makes sense with established APIs. That's precisely why python is doing a 2.6 version to bridge the gap.

  33. Re:Duh by chromatic · · Score: 2, Insightful

    The people who put them together are not getting paid by you and don't really care about your company's schedules.

    Very true, but we do give you the complete source code to all of our older versions. Go crazy.

  34. How did that Cripple PHP by alexhmit01 · · Score: 4, Insightful

    PHP 5 was a MAJOR over-haul, biggest since PHP 4. When PHP 4 came out, hosts and OSes supported 3/4. PHP 3 has really cool, but extremely insecure, syntax things for web prototyping. When you posted a variable, put it on the query string, or passed it in a cookie, it just came into the script as ${name}. So if you needed to check for setting, it was isset($variable), using it was just using it, etc. This was dangerous because in PHP you don't declare your variables, so if you assumed that a variable you never zero'd/nulled before usage was null at the beginning, this could be exploiting by posting a value.

    PHP 4 had a php.ini setting to use the old mode (I think register globals or something similar) that helped in the migration. Also, include_once/require_once massive simplified using libraries. Before that we had to do our own equivalent of ifdef/ifndef in our PHP code to avoid overwriting a function if two included libraries called it.

    The PHP 3 -> PHP 4 transition took a while as well. What's the rush, my new systems all include PHP4 AND PHP5. All my new code is PHP 5. My PHP4 stuff happens to be in legacy mode, but if I needed to bring it will us, you put it on a machine and see what works, what doesn't, and add support for 4 AND 5, like we all used to do on PHP 3/4.

    Better to introduce some source incompatibility for improvements then not being able to move forward, just make sure that there is a transition strategy. Three years isn't really that long... though when I started in web stuff, 3 years was an eternity, but 8 years later, eh, just a few more years.

    1. Re:How did that Cripple PHP by raehl · · Score: 2, Funny

      PHP 5 was a MAJOR over-haul, biggest since PHP 4.

      One can only guess when the next major overhaul will be. Who knows, it might even be PHP 6.

  35. A cunning plan by Anonymous Coward · · Score: 3, Insightful

    Calling the new language "Blackadder" is a plan so cunning that if you put a tail on it you could call it a weasel.

  36. Not 100% by agbinfo · · Score: 2, Informative

    I had to port Perl 4 code to Perl 5 and there were some issues.

  37. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 2, Insightful

    Your example is quite absurd, since your pretty matrix code is perfect python, up to changing the ; into commas, and adding the missing commas:

    A=[[ 71,  211,  211,  131,  221,  131,  201,  221,   81,  214],
    [   131,  161,  141,  221,   51,   81,  171,    1,  241,  160],
    [    31,  201,   91,   41,   71,  111,  111,  191,  181,   34],
    [   171,  161,  171,  251,  161,   51,  141,  241,  101,   53],
    [    91,   81,  131,   61,   71,  141,  201,  251,  191,  155],
    [   221,   71,  111,   61,  121,  191,   11,  201,   61,  161],
    [   211,   81,  171,  221,   11,  131,  151,  111,  111,   94],
    [   151,  131,  151,  181,  251,  161,   11,  121,  231,  147],
    [   121,  181,  201,   31,  141,   51,  101,   51,  171,  115],
    [   231,   71,  241,    1,  101,   91,   71,  161,   51,   11]]

    If that was your argument to show that `python forces you to write horribly formatted code', well, you need another argument.

    In any case, have you seen the huge amounts of pretty good python code out there? I have yet to see something which would rightfully be described as `horribly formatted'.

  38. Re:Python to not be backwards compatible by Kadin2048 · · Score: 3, Informative


    If it isn't backwards compatible, it isn't Python, as far as I'm concerned. I'm sure not going to be re-writing a couple hundred megabytes of code. They can take their incompatible new snakelike thing and smoke it. Foregoing backwards compatibility is about as dim a move as I've ever seen anyone outside of Microsoft pull (MS dropping VB underneath Access comes to mind as a comparable clueless act, with exactly the same consequences — it isn't the same product and is useless to me.)

    I don't think anyone is really suggesting that a lot of code be rewritten. Python 2.x isn't going anywhere, for exactly the reasons you bring up. Python 3.0 is going to be almost a completely new product, and I expect it'll only be used for new projects. I'm not really sure why anyone would want to convert their old code, if it works for you the way it is.

    The reason for breaking compatibility is to maintain the Python philosophy of not having a lot of ways to accomplish the same thing. Without periodic pruning, eventually you'd just have Perl with indents.

    From what I've read, you'll be able to choose the version/style you want, and the 2.x and 3.x series will live alongside each other (I don't know whether the 3.x interpreter will have a compatibility mode, or if you'll have to keep the 2.x version around as a separate program, though).
    --
    "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
  39. Can we put in requests? by the-matt-mobile · · Score: 3, Insightful

    If we're breaking compatibility, can we put in requests? The 3 main things I'd like to see are:

    1.) Ditch the silly ":" at the end of the line when starting a block. Why on earth is this needed? I almost always forget to use that darn colon.

    2.) Ditch the bolted OO on "self" variable for object methods. Just make "self" a keyword and use it the way "this" works in Java/C#/C++.

    3.) Allow for a whitespace agnostic mode with the end keyword the way Boo did for goodness sake! Why on earth is that so hard? If you want significant whitespace, it can still be the default. If significant whitespace drives you mad, then use a -wsa switch and a new "end" keyword and be done with it. It would end the flamewars and make Python a more acceptable language to those of us who prefer to have the option of aligning our code the way that makes the most sense, not the way the language Guido thought it should always be.

    1. Re:Can we put in requests? by debatem1 · · Score: 2, Informative

      I'm posting this all over this thread. If you like curly braces, this might be what you're looking for. It's called curlyPy, and it allows you to just use k&r or java style curly braces to delimit blocks, and to hell with whitespace.

  40. Re:Python to not be backwards compatible by b17bmbr · · Score: 2, Insightful

    Python 2.x isn't going anywhere, for exactly the reasons you bring up.
    which is the whole point of open source isn't it. 2.x will always be "free" and you can choose. a friend told me once that his firm did custom NT server (don't know or remember the specifics of the thing) install with their software (this was a long time back) and the firm pre-bought tons of NT licenses since they knew NT would be replaced and they wouldn't be able to get it anymore. that'll never happen with FOSS. and, that's the beauty of the free (beer and speech) market, if the product isn't to your liking, you get a new one that is more so.

    I wrote a LAMP app for my school, a simple tardy slip program. since I had older versions of A(1.3)M(3.x)P(4.x) on my ibook to develop on, and all we had were PC's at school, I downloaded an older version of fedora (I think) with the older versions. since everything copied over easily, install/set up was no problem. it's been up and running for a year and a half. could I do it with 2.x, 5.x, 5.x? sure, but I am not in the mood to rewrite.
    --
    My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
  41. Re:Python to not be backwards compatible by Wheat · · Score: 2

    The Python 2 to Python 3 transition is not the same as Perl 5 to Perl 6. Perl 6 is a major rethinking of Perl, with a lot of changes. Python 3 is still very similar to Python 2 with very few syntactical changes - the primary motivation for Python 3 to break backwards compatability was to be able to purge implementation cruft from the language that was mostly derived from early design mistakes.

    It's true that you'll need to do work to port/test code from Python 2 to Python 3, but learning the syntactical differences can be done in an afternoon, as there aren't that many:

    http://docs.python.org/dev/3.0/whatsnew/3.0.html

  42. Keyword replacement by gokeln · · Score: 2, Funny

    That's funny. My understanding is that the mods are much more serious than this article lets on. From what I heard they're replacing all the keywords and indentation with some combination of parenthesis, lambda, car and cdr. The language will be SO much improved!

    --

    There's no time to stop for gas, we're already late.
  43. Re:Python to not be backwards compatible by timmarhy · · Score: 3, Insightful

    the problem is at some point they are going to drop support for it, and no modules will begetting written for it either. the fact that you can maintain it yourself is a retarded response to this, because people who say it have pretty much no idea how much extra work that puts back on you, and frankly no one wants that.

    --
    If you mod me down, I will become more powerful than you can imagine....
  44. Re:Python to not be backwards compatible by Vellmont · · Score: 2, Informative


    the problem is at some point they are going to drop support for it

    Welcome to software development.

    What products don't eventually become unsupported? Even a compiled language like C or C++ has libraries that eventually become unsupported, and maintaining them even if you had the source would become a difficult task.

    --
    AccountKiller
  45. Re:Damn right by ben+there... · · Score: 2, Informative

    To expand on that:

    4. Unicode will become the standard throughout Python. This is probably the biggest change. Whereas before the String datatype was synonymous with a byte array (and used for both), it no longer will be. This entails some additional changes in your code to specify the encoding of a String, which will now be represented as Unicode. A new datatype, called "Bytes" (IIRC) can replace the former byte array use of Strings.

    5. Many modules in the Standard Library which have been marked deprecated for several versions now (and raised a DeprecationWarning exception) will now actually be removed. Several others with old naming conventions, ambiguous names, or dual Python/C implementations will be renamed, with an appropriate backward-compatible stub that issues the same DeprecationWarning exception, but still works with the old name. A running tally of modules to be removed/renamed is in PEP 3108.

    The bottom line is that they are not just making backward-incompatible changes for the sake of changing things. They are specifically trying to avoid "becoming the next Perl 6" to paraphrase Guido from one of his Google Tech Talks. They are just taking this one chance to remove longstanding "warts" from the language in one fell swoop.

    Almost everything will be covered by the 2to3 converter. Where required changes are ambiguous, 2to3 will issue a warning and request you fix it manually. I'd rather they fix the problems with the language now before they get any more entrenched. But then, I'm not a maintainer of "legacy" Python code. I am looking forward to the Generic Functions and Adaptation features (among other things) that are being discussed for Python 3000 though.