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

438 comments

  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 simcop2387 · · Score: 1

      Python apparantly, Perl6 is backwards compatible with Perl5 even though it has many new features

    2. Re:It's a race by drolli · · Score: 1

      And i think perl 5 was compatible to perl 4 (AFAIR). Just adding things...
      I really dont want to know ho perl will look in 20 years....

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

      While both Perl and Python are in need of a fat trimming in terms of obsolete and redundant language features, I think Python has a small enough user base that they could actually pull it off.

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    4. Re:It's a race by Anonymous Coward · · Score: 3, Informative

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

    5. Re:It's a race by FuzzyDaddy · · Score: 1, Redundant

      15% of the google codebase consitutes a "small user base"?

      --
      It's not wasting time, I'm educating myself.
    6. 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.

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

      Yes.

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    8. Re:It's a race by jellomizer · · Score: 0, Flamebait

      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.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    9. 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.
    10. Re:It's a race by Anonymous Coward · · Score: 0, Redundant

      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.
      Please stop rewriting history.

      • Perl was never "use (sic) for almost every app out there". It has always been used within certain niches (system administration, database access, CGI, and command-line glue). It has hardly ever been used for other things like desktop GUIs etc.
      • There has not been any such thing as a "move to perl 6". Perl6 is indeed in development, and has been for a long time... but so is Perl5, which had a major new release, with many added features, just a month ago!
      • The "apps" have not "gone away". I don't know if it's escaped your notice, but the incredibly popular website you're using right now has not been rewritten in Python yet.
      But I guess it's unreasonable to expect little things like truth and reality to have any play on Slashdot, where everyone's always twisting the facts to try and justify racing off after the next shiny. (Aren't you a little behind the curve hyping Python? That was last year's big thing, all the cool kids are jerking off over Ruby now, while the grown-ups keep on doing serious work with Perl.)
    11. Re:It's a race by misleb · · Score: 1, Offtopic

      Check out your statistics sometime perlfag, you might be surprised. Most of the real world got sick of waiting for Perl 6 a long time ago and moved to languages like Ruby and, yes, Python.


      Actually, I'm more of a Rubyfag. But thanks for the sentiment.

      -matthew
      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    12. 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?

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

    14. 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.
    15. Re:It's a race by CastrTroy · · Score: 1

      Yeah, just like VB.Net was backwards compatible with VB.Net, and ASP.Net was backwards compatible with ASP. Companies will try to tell you their product is backwards compatible to get you to upgrade. However, a lot of the time backwards compatible requires that you rewrite a lot of your code.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    16. 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.

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

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

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

    19. Re:It's a race by CastrTroy · · Score: 1

      Yes, but they probably still want people to think they can upgrade easily. If too many people keep using Perl 5, then they have to keep on fixing bugs in it. If they can get a large percentage of people onto Perl 6, then they can just abandon Perl 5, and let those few people who are still using it fix it themselves.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    20. 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.)

    21. 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.
    22. Re:It's a race by cheater512 · · Score: 1

      Yeah but once marketing execs get on to it, they will tell you that the Mars rovers use it exclusively and that God himself coded some of the cooler animals in it. ;)

    23. Re:It's a race by kestasjk · · Score: 1

      It's impossible to keep a language compatible while adding good new features. I'd rather have good new features than be able to run legacy and modern applications on the same platform.

      If it's a backwards compatible update it's probably either really cludgy, or the updates are fairly trivial, and they'd be getting just as much slack for that. If it's a version upgrade (x.0 and not 1.x) that means backwards compatibility can be broken, that's pretty much the universal convention, from languages to operating systems.

      --
      // MD_Update(&m,buf,j);
    24. Re:It's a race by EdelFactor19 · · Score: 1

      according to your own post it IS not, it WILL be. call me an english nazi, or call me a technicallity nazi i dont care... id prefer soup nazi tho.

      the point is that they are not backwards compatible. it will end up supporting "most" but not all.

      If we started judging things by what they will be, then DukeNukemForever would be a fanstastic game we've all played.. Granted I have an unlimited amount of additional faith in the python team and that this will occur and occur ahead of schedule (as opposed to vaporwear of the year for over a decade). but the point is if its truly backwards compatible its a quick yes no answer with no details needed. thats what compatibility is. Compatibility is not supporting most feaures and not others. If we used that definition then websites that I blatantly can't use (ABC.com to watch a show online) could be called Linux Compatible... with a couple asterisks stating that x and y and z arent supported yet.

      take this all with a grain of salt, as I'm not sure exactly what will and won't be supported; if its just some arcane feature that isnt supported than they are probably just being over cautious on naming.. but I'd prefer our software world not turn into a tv commercial with a 20 second long legal mumbo jumbo disclosure line raced through after every announcement :-)

      --
      "Jazz isn't dead, it just smells funny" ~Frank Zappa
      EdelFactor
    25. 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.

    26. Re:It's a race by cosmicklev · · Score: 1

      I don't seem to remember any claims by MS that VB and VB.NET were compatible or ASP.NET would be compatible with classic ASP. What they provided were conversion tools instead.

      It was pretty obvious from the get go that the .NET was a completely different technology from ASP/VB/COM and that your legacy apps were never gonna run without a fair bit of work either with the conversion tools or a rewrite. MS never made any noises to suggest otherwise.

    27. Re:It's a race by WWWWolf · · Score: 1

      irb(main):001:0> "ruby" > "python"
      => true

      Hey, we've discovered how to automate the language flamewars! Now all we need is an interoperable, multi-language API for automated language flamewars, so that we don't need any human intervention at all!

    28. Re:It's a race by dotancohen · · Score: 1

      Yes, in the same sense that IE8 will be backwards compatible with IE6.

      --
      It is dangerous to be right when the government is wrong.
    29. Re:It's a race by Wdomburg · · Score: 1

      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.

      I'd say adopting the perl5 concat operator as the perl6 dereference operator will be at least as much a headache. :)

  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 BigJClark · · Score: 1


      Yikes, don't do that. I think its easier to determine which version is newer or older based on the version number associated with it.

      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

      I realise its boring, but please, think of the children.

      --

      Hi, I Boris. Hear fix bear, yes?
    3. 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
    4. Re:Just rename it. by sumdumass · · Score: 1

      I agree that if it is so incompatible it should have a name change. But I might suggest something a little less obvious like Python.three instead of using the three as a 3 versioning number.

      I hear the changes aren't supposed to be that drastic but then again, I have to wonder why the heads up if that was the case. Maybe as it gets closer, we will see that it is stuff so obscure that it won't bother 99% of everyone.

    5. Re:Just rename it. by workdeville · · Score: 1, Insightful

      Yikes, don't do that. I think its easier to determine which version is newer or older based on the version number associated with it. Who cares about "new" versus "old"? All I care about is whether my/other code will work on a particular interpreter. And figuring that out is harder if interpreter names aren't tied to major language changes. Perl 6 has the advantage of being backwards compatible with Perl 5, despite many changes to the language.

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

    8. Re:Just rename it. by anno1602 · · Score: 1

      You forgot "Black Mamba" (SCNR)

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

    10. Re:Just rename it. by Anonymous Coward · · Score: 0

      Yeah, it worked when I used to be a baker. "They're not burned, they're double-dark-chocolate Hershey cookies."

    11. Re:Just rename it. by aesiamun · · Score: 1

      Why is this lie continually spoken across the internet?

      http://www.programmersheaven.com/2/Perl6-FAQ-Migration#bc

    12. Re:Just rename it. by BigJClark · · Score: 0, Flamebait

      Low flying 747. Completely missed the point. I'm not even going to quote Mark Twain on this one.

      --

      Hi, I Boris. Hear fix bear, yes?
    13. 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?

    14. 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.
    15. 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.
    16. Re:Just rename it. by Anonymous Coward · · Score: 0

      Ah, that would be great. My python is named Oroboros...

    17. Re:Just rename it. by Tritoch · · Score: 5, Funny

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

    18. Re:Just rename it. by dfdashh · · Score: 1

      I present to you the newest incarnation of what once was the Python programming language: something.

      What can you use for your rapid application development needs? something. What about handling those tricky image manipulations? Give something a try. Terrified of Mr. Bean quotes? something will lead you to a better pasture!

      In my 25 years of problem solving in an IT environment, I find that something would have solved it.

      --
      df -h /my/head
    19. Re:Just rename it. by xactuary · · Score: 0
      Your solution is Cobraic, but not all that pythonic.

      --
      Say hello to my little sig.
    20. Re:Just rename it. by ATMD · · Score: 1

      While talking about puns, snakes and coming full circle, I suggest Ouroboros.
      Which links in nicely with Red Dwarf, too.

      But I agree that if they do rename it, "Adder" would have to be the way to go.
      --
      Nobody else has this sig.
    21. 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!
    22. 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.
    23. Re:Just rename it. by Kadin2048 · · Score: 1

      Well, by some of those definitions, Python 3 will be 'backwards-compatible' with Python 2, because it's apparently planned that the Python 3 interpreter will have a compatibility mode for 2.x syntax.

      IMO, that doesn't really mean that the "languages" are backwards-compatible, it just means that the interpreter is. That's different, although I know it's confusing when one particular interpreter is the de facto standard for the language, and people talk about the language in terms of the interpreter that it's used with.

      I'd argue that both Perl 6 and Python 3 are backwards-incompatible, but both have interpreters that will work with the older syntax. It's the interpreters, the implementation, that's compatible to a certain degree (and quite similarly in both cases).

      In the case of Perl there's also automated conversion tools (planned?), and I don't know if such a thing is in the works for Python ... but I don't think that the presence or absence of a conversion tool really has anything to do with the language's compatibility per se. I've seen converters for going from C to Java or even Cobol to Java; does that mean that Java is "backwards-compatible" to Cobol? Of course not.

      --
      "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
    24. Re:Just rename it. by orclevegam · · Score: 1

      Of interest is that the Perl5 compatibility module will allow Perl6 to call Perl5 code, and possibly even Perl5 code to call Perl6 code (or else passing sub refs for callbacks is likely to break some old modules) which offers quite a bit more flexibility then a static converter or an all-or-nothing mode switch on the interpreter. I don't know about Python but I suppose it might also offer similar functionality as apparently the interpreter can run Python 2 code. As for the Cobol to Java thing, if the standard JVM was capable of executing COBOL code directly I would probably argue that it is to some extent backwards-compatible. Microsoft has gotten away with it for years, after all, all those old DOS applications ran in Windows by executing inside a virtual DOS emulator, which is essentially what Perl6 and Python 3 are doing.

      See, that's the problem here, the phrasing is somewhat muddled depending on how you choose to interpret the word backwards-compatible, and exactly what you're referring to when you talk about things like Perl6 and Python 3 (that is, the language, the interpreter, both, libraries, etc.).

      --
      Curiosity was framed, Ignorance killed the cat.
    25. Re:Just rename it. by Anonymous Coward · · Score: 0

      No, no, no... the next version of Python would be Spamalot. Haven't you learned anything?

    26. Re:Just rename it. by rahvin112 · · Score: 1

      But which version of Blackadder? If we renamed Python Blackadder I would always be wondering if it's the 12century, the 17th century or WWI. This could have serious implications to the context and even syntax of the code.

    27. Re:Just rename it. by QuestorTapes · · Score: 1

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

      Our Rob Or Ros? Not only couldn't they pick a name for the poor little fella,
      they can't spell, either! Leaving him in a cardboard box under a pool table!

      Tch!

    28. Re:Just rename it. by wondershit · · Score: 1

      This reminds me of all the programming languages named D.

    29. Re:Just rename it. by Anonymous Coward · · Score: 0

      That also means the zealots can reinvent he bad reasons to push their glorified scripting language.

    30. Re:Just rename it. by TeknoHog · · Score: 1

      Or, for another British fiction reference, I suggest Parseltongue.

      --
      Escher was the first MC and Giger invented the HR department.
  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 Eco-Mono · · Score: 1

      Especially since, y'know, the plan to let Python 3000 be backwards-incompatible has been in place for at least two years now.

      *shrug*

      --
      (rot13) rpbzbab@tznvy.pbz
    4. 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.

    5. Re:Another Shock Story by Anonymous Coward · · Score: 1, Informative

      This is just not true. There will be a utility included with py3k that converts most purely syntactical differences from py2.x code into compatible running py 3.0 code. The official word on this is that the recommended upgrade path is to maintain your codebase as 2.x code that can also be converted into python 3.0 code in a completely automated way (that is, keep it compliant with py 2.6, but change things so that the automater script can generate py 3.0 code). When backwards compatability is no longer needed you can convert to the 3.0 codebase.

      If anything its a long term upgrade path, not some "OMG EVERYTHING WILL BREAK NEXT YEAR" type crisis.

    6. Re:Another Shock Story by Anonymous Coward · · Score: 0

      Not true. You will be able to write 2.6 code that will be machine-translatable to 3.0, using a supplied tool (2to3). There will be no need to maintain two code bases.

    7. Re:Another Shock Story by MrLizardo · · Score: 1

      First of all, the framework already exists in Debian (and I'm sure RedHat-based distros...) to have two versions of Python installed. This is not rocket science. And before you gloat too much about C++, having two versions of g++ installed has been a fairly constant experience for many Linux users as well. This is totally a non-issue and will make no difference to package maintainers...

      --
      ^I'm with stupid.^
    8. Re:Another Shock Story by LWATCDR · · Score: 1

      It is an issue for new projects.
      If you are going to start a project today do you use python 2.x or wait for python 3.x?
      Someday one of them well go bye bye and somebody will have to fix the problems that causes.
      What if you are going to embed python into an application as a macro language?
      No the sky isn't falling. The sky never rarely does fall. But it is an issue.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    9. 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
    10. 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
    11. Re:Another Shock Story by daeg · · Score: 1

      99% of code can be translated from 2.6 to 3.0 with the 2to3 tool. I imagine it is just another step to add in the "publishing" phase of building your project, e.g., (1) Checkout from source control (2) Install local changes/configuration files (3) Run 2to3 (4) Done.

    12. Re:Another Shock Story by morgan_greywolf · · Score: 1

      This is just not true. There will be a utility included with py3k that converts most purely syntactical differences from py2.x code into compatible running py 3.0 code. The official word on this is that the recommended upgrade path is to maintain your codebase as 2.x code that can also be converted into python 3.0 code in a completely automated way (that is, keep it compliant with py 2.6, but change things so that the automater script can generate py 3.0 code). When backwards compatability is no longer needed you can convert to the 3.0 codebase. I wish you could tag comments. I would tag this one 'whatcouldpossiblygowrong'.

      Does anyone else here remember the Turbo Pascal 3.0 -> 4.0 upgrade fiasco? There were supposedly (3rd party, I think) applications that would look at your TP 3.0 code and upgrade it to 4.0. None of them worked, of course.
    13. Re:Another Shock Story by Anonymous Coward · · Score: 0

      Actually there's very few backwards-incompatible functions that changed between PHP 4 and 5 and a couple of changed default settings. The vast majority of PHP4 code runs (and is running) fine on PHP5. No hosts bothered to upgrade to PHP5 because it's just PHP4 with (more or less) proper OOP constructs which it seemed nobody cared to learn anyway. So really it's a case of PHP not breaking enough stuff :).

    14. Re:Another Shock Story by pthisis · · Score: 1

      OTOH, 2to3 has worked perfectly with all of my python code. The changes are largely mechanical, the most notable being that in python 3 "print" is now a function so you need parens around the arguments (the gain being that you can easily change its behavior, e.g. to implement logging or whatever).

      --
      rage, rage against the dying of the light
    15. 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.

    16. 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
    17. Re:Another Shock Story by DragonWriter · · Score: 1

      Does anyone else here remember the Turbo Pascal 3.0 -> 4.0 upgrade fiasco? There were supposedly (3rd party, I think) applications that would look at your TP 3.0 code and upgrade it to 4.0. None of them worked, of course.


      Um, Python 3.0 is already out in alpha, and the conversion tool is available. Rather than fearmongering based on something that happened with a different language, in the 1980s, when the tools were 3rd party rather than part of the release of the new version, why not look for some evidence that the conversion tool at issue doesn't actually work to criticize it?
    18. Re:Another Shock Story by Jugalator · · Score: 1

      Or something like 3 years has actually been planned as a reasonable support length for Python 2.x?
      Isn't that reasonable? I mean, that's not a catastrophic time for a big programming language to exit a transition of a major update.

      --
      Beware: In C++, your friends can see your privates!
    19. Re:Another Shock Story by rbanffy · · Score: 1

      This is absolutely painless in any modern Linux distro. Here I have both python2.4 and python2.5 in /usr/bin and a symlink at /usr/bin/python leading to one of them. All I had to do was to install the "python-2.4" (or something like it) package. Nothing broke. If I had something that broke under 2.5, I could change the #! line to read "python2.4" instead of "python" and everybody would be happy again.

      It wouldn't be painful even if I were to hand-compile my own versions - some masochistic thing I am not inclined to do.

      There is no need to panic. The Python crew knows fairly well what they are doing.

    20. Re:Another Shock Story by smallpaul · · Score: 1

      Although "hosting" is not totally irrelevant to Python programmers, it is a much less important aspect of the Python world than for PHP. Python is not primarily used for web development and when it is, it is often in a virtual machine-type situation.

    21. Re:Another Shock Story by Hamilton+Lovecraft · · Score: 1

      You must be new here.

      --
      step 3: god dammit, it doesn't work
    22. Re:Another Shock Story by Intron · · Score: 1

      I once told someone I was a C programmer and he said "Maybe you could study".

      --
      Intron: the portion of DNA which expresses nothing useful.
    23. Re:Another Shock Story by rk · · Score: 1

      It wouldn't be painful even if I were to hand-compile my own versions - some masochistic thing I am not inclined to do.

      I have found that when I need multiple versions of python on a system, compiling and maintaining those versions from the original source tarballs is very simple, and usually faster than hunting to see if there's a package for the distro/python version combos I need. Sometimes I have some issues with GUI toolkits, but for the most part, it's really just not that difficult.

    24. Re:Another Shock Story by rbanffy · · Score: 1

      Aw... Come on... Can't be much less painful than "apt-get install python2.4"

    25. Re:Another Shock Story by Anonymous Coward · · Score: 0

      Yes, but many hosts refusal to upgrade PHP is based off of laziness and a lack of necessity and not really so much that it would have broken too much code. Unless you really forced your PHP4 code into a pseudo-object oriented structure that will break due to PHP5's new OO paradigm, then your PHP4 code should be fine in a PHP5 environment for the most part.

      The second rate hosting companies which flood the market have no need to invest or interest in upgrading PHP...or even any interest in upgrading MySQL. Heck, your average website owner that claims to know PHP can barely write coherent PHP code to begin with, let alone even know what version of PHP they run. I know plenty of web designers that couldn't tell you one difference between 4 and 5 and still run around claiming they know PHP.

      These reasons, I feel, are why PHP5 is crippled. With Python, I feel the case will be completely different.

    26. Re:Another Shock Story by Anonymous Coward · · Score: 0

      Sure they aren't.

      And I suppose you think they intend to maintain those releases all the way up to 2.9.9.9.9.9.9.9.etc while everyone's moving to 3.0, seeing as how there's no point in writing an app in a language that isn't even compatible with its successor?

      Spoken like a true Slashdot subscriber. Every time I see that fucking * next to some shithead's name I know without certainty that they're full of shit.

      By the way asshat, now that you whored yourself out to a website, are you glad to be getting all of those stories posted from Digg a little bit earlier? You could have saved yourself the time and just went to Digg instead, rather than wait for Slashdot to pick the bones or front-page some moron's journal postings.

      You are Slashdot's bitch. Mull over that thought for a while.

    27. Re:Another Shock Story by cripkd · · Score: 1

      Hmm, no.

      Actually php4 code runs perfectly on php5, maybe some stuff throws warnings at worst. So how is that not-backwards-compatible? I never imagined that meand that i'm supposed to be able to run python 3 or php5 code on python 2 or php4, right?

      I never saw it like that, on the contrary, people were never satisfied with the level of "cleaning" that php5 brought. Stuff like register_globals can still be set to on, a lot of function names are still not in tune with the rest of the language and so on.

      PHP6 will bring some of that, but again issues are left unsolved. I would have preferred some badly named functions to throw off notices at least instructing you to use the new prettier function and discontinue the old one in php6. or give up stuff like register globals from php5.

      I know function names is not the key factor in a language or that register globals is not the only php issue, but to conclude, 1, php did the exact opposite and 2, i'd have chosen then what python does now. Would have helped mature and grow the language sooner of its script kiddie market.

      --
      Curiously yours, crip.
    28. Re:Another Shock Story by rk · · Score: 1
      Current system I'm working on:

      [root@workflow src]# apt-get install python2.4
      -bash: apt-get: command not found
      Well, shit. :-)
    29. Re:Another Shock Story by Anonymous Coward · · Score: 0

      As you can hear from Guido's own mouth:
      http://video.google.com/videoplay?docid=1189446823303316785 (relevant part is at 1:16:00)
      The official method of compatibility will be to maintain a single code base, version 2.6, then run the 2to3 converter. If the 3.0 code doesn't work DON'T TWEAK THE 3.0 CODE. Change the 2.6 code, then run the 2to3 function again. Thus, only one code base need be maintained.

    30. Re:Another Shock Story by Sentry21 · · Score: 1

      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. Most distros and package-management systems include multiple versions of many scripting languages already. Debian and fink both have python2.3, python2.4, and python2.5, though arguably fink handles it better than Debian does. It's not that much of a hassle, in the end, and it's very useful for when you require some new feature of Python (or some old feature of Python) but don't want to verify all of your scripts. For example, if you have a giant script that uses 'yield' as a variable name all over the place, it's going to break when you update Python and yield is now a reserved keyword. Same with the new division operator - if you do a lot of division operations, you don't want to go through your code line by line looking for division and check to make sure that it's doing it properly.

      Multiple versions is nothing new.
    31. Re:Another Shock Story by Anonymous Coward · · Score: 0

      Funny? I thought it was +0 informative-but-we-already-knew-that.

      In fact I have python2.4 and python2.5 installed on my Debian system, and I recall not long ago we had python2.3 and 2.4 packages. And to the GP: not too long ago g++ accepted incorrect behaviors like automatically using the "std" namespace and stuff like that. GCC 3.x broke all that too. In fact I've encountered minor compilation problems when compiling some software project with gcc4.x that was apparently developed with gcc3.x...

    32. Re:Another Shock Story by stm2 · · Score: 1

      Several distros already has more than one Python installation (like Freespire 1.013, comes with 2.3 but you can install 2.4 using package managment or 2.5 by compiling it yourself). The same happens with some 64bits distros, they have both x64 libraries and "standard" 32 bit packages.

      --
      DNA in your Linux: DNALinux
    33. Re:Another Shock Story by Anonymous Coward · · Score: 0

      As if GCC wouldn't become stricter with every major release and wouldn't break ABI as well...

    34. Re:Another Shock Story by rbanffy · · Score: 1

      I am sorry for your suffering. I too have used Irix, HP-UX, AIX and Solaris (and OSX without Fink) a lot.

      It's next to unbearable.

    35. Re:Another Shock Story by smittyoneeach · · Score: 1

      Or you could maintain your commitment to Blutarsky-ism and slouch your way to D

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    36. Re:Another Shock Story by Anonymous Coward · · Score: 0

      The biggest flaw of c++ is that it didn't break backwards compability.

      And that it's c++.

    37. Re:Another Shock Story by Fencepost · · Score: 1

      Sounds like range() is being replaced by xrange().

      (xrange() doesn't actually allocate the list)

      --
      fencepost
      just a little off
    38. Re:Another Shock Story by manly_15 · · Score: 1

      Most admins are all ready maintaining multiple python installations. Usually you have python2.3, python2.4, and so on with the python symlink pointing to your preferred version. Debian, Ubuntu, and Freebsd all work this way, and very rarely is it a pain.

    39. Re:Another Shock Story by Breakfast+Pants · · Score: 1

      eval("pri" + "nt 'however unlikely to occur in real code, some stuff will still be undetectable'")

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    40. Re:Another Shock Story by tokul · · Score: 1

      PHP did exactly the same between version 4 and 5
      It is closer to "PHP will do exactly the same in version 6". PHP4 and PHP5 are not totally backwards incompatible. Same code can run in both versions, if you are not using complex classes or objects. Both Python3 and PHP6 are breaking backwards compatibility in their implementations of Unicode support.
    41. Re:Another Shock Story by fatphil · · Score: 1

      Interesting to see that you missed out the (3.5) Regression test phase. Now I know why most code written today is of such poor quality and so fragile.

      --
      Also FatPhil on SoylentNews, id 863
    42. Re:Another Shock Story by daeg · · Score: 1

      I assumed that would be done as part of a testing and QA. So I guess that's more like (0.5) and (3.5) would be smoketest.

  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.

    2. Re:Workaround... by Crazy+Man+on+Fire · · Score: 1
      Actually, the article says that 2.6 and 3.0 will be released around the same time:

      The Python development community was committed to providing a smooth upgrade path and will build a number of forwards-compatible new features into the next release of the current version of the language, version 2.6. This release is expected to come out around the same time as the release of 3.0, said Baxter.
    3. Re:Workaround... by fahrbot-bot · · Score: 0
      Python2.6 is slated to include a tool which will update purely syntactic differences to Python 3 automatically.

      To keep the tool fast and small, it will be written in Perl. :-)
      Again... Joking (Am I?), No really. ...

      --
      It must have been something you assimilated. . . .
    4. Re:Workaround... by rbanffy · · Score: 1

      Still, nobody is forcing you to adopt 3.0 the day it's released. I run Python 2.4 and 2.5 on the same box (along about half a dozen combinations of Zope and Plone) and they seem to play very, very well together.

      the fact 3.0 will become available will not break 2.x code overnight. No need to panic.

    5. Re:Workaround... by rk · · Score: 1

      "Funny once, Mike." :-)

    6. Re:Workaround... by fahrbot-bot · · Score: 1
      Funny once

      Ya, I went for it anyway and it bit me. Thanks.
      Perhaps if I had indented it?

      --
      It must have been something you assimilated. . . .
  5. Solid technical reasons by Anonymous Coward · · Score: 0

    It has something to do with the fact that the fangs curve backwards.

  6. 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.
    3. Re:print as function vs. keyword by deanlandolt · · Score: 1

      ...the function call approach works in both 2.5 and 3.0... I call bullshit:

      C:\Documents and Settings\bullshit>python
      Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
      win32
      Type "help", "copyright", "credits" or "license" for more information.
      >>> print 'Old approach in python', 2.5
      Old approach in python 2.5
      >>> print('Function call in python', 2.5)
      ('Function call in python', 2.5)
      >>>
      The function call approach outputs prints a tuple to stdout -- quite different.
    4. Re:print as function vs. keyword by Bogtha · · Score: 1

      You are correct, but the common case of printing one value is identical. Read PEP 3105 for the details.

      --
      Bogtha Bogtha Bogtha
    5. Re:print as function vs. keyword by Abcd1234 · · Score: 1

      It's good that they're getting rid of a couple of them, though while, if and the like still remain.

      Might I suggest just switching to Smalltalk?

      [ booleanExpression ] whileTrue: [ self anotherMethod ]

      [ booleanExpression ] ifTrue: [ trueBlock ] ifFalse: [ falseBlock ]

      1 to: 5 do: [ :i | Transcript show: i; cr; ]

    6. Re:print as function vs. keyword by deanlandolt · · Score: 1
      I disagree that it's the most common case, but as the PEP you pointed to mentions:

      Luckily, as it is a statement in Python 2, print can be detected and replaced reliably and non-ambiguously by an automated tool, so there should be no major porting problems (provided someone writes the mentioned tool). Works for me.
    7. Re:print as function vs. keyword by morgan_greywolf · · Score: 1

      Not really.

      me@myhost:~$ python
      Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)
      [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> print ("test")
      test
      >>> print "test", 2.5
      test 2.5
      >>> print ("test", 2.5)
      ('test', 2.5)

      This last one is because syntactically ("test", 2.5) is a tuple. Next, let's look at more precise way to do it:

      >>> print ("test %s" % 2.5)
      test 2.5

      And this works exactly as before:
      >>> print "test %s" % 2.5
      test 2.5

      So, no, parent is correct.

    8. Re:print as function vs. keyword by deanlandolt · · Score: 1

      It's only a tuple because print is a statement, not a function. This statement, sans parens, allows me to pass it an n-length tuple and it concatenates the __repr__ of these items into a nice string, separated by commas...

      Now, I agree that perhaps print *shouldn't* be a statement. Perhaps I *shouldn't* be abusing it so, but I am. Of course, the 2to3 tool will no doubt patch up my unpythonic ways, and I'm alright with that. But you and GP are incorrect -- there _will_ be backward incompatibilities in my not-too-distant future.

    9. Re:print as function vs. keyword by harry666t · · Score: 1

      I don't believe it will be that easy, or will "Just Work(tm)" out of the box. In Python 2.4 and 2.5 (dunno about earlier versions) print statement is a part of the syntax. There are constructs like 'print >> object, "text"' and 'print "something else",' (notice the comma). How this is going to be handled?

      Also, Python can execute strings of python code generated on the fly, like this:

      >>> foo = "print "
      >>> bar = "'Hello!'"
      >>> exec foo+bar
      Hello!
      >>> print foo+bar
      print 'Hello!'

      How can 2to3 tell apart which string is going to be executed, and which printed?

    10. Re:print as function vs. keyword by morgan_greywolf · · Score: 1

      If you want to print the __repr__ of a tuple, wouldn't the most correct way just be:

      print ("%s" % ("test", 2.5))

      If you'd been doing that all along like the rest of us, you wouldn't be having any problems. *tongue firmly planted in cheek*

    11. Re:print as function vs. keyword by Anonymous Coward · · Score: 0

      The function call approach works also in 2.4.4...not sure how far back it works.

    12. Re:print as function vs. keyword by morgan_greywolf · · Score: 1

      No, wait, that wouldn't work, would it?

      It would have to be

      print (repr(("test", 2.5))

      Argh. I think you're right. This is annoying. :-P

    13. Re:print as function vs. keyword by morgan_greywolf · · Score: 1

      Argh! I left off a trailing parenthesis!!!

      print (repr(("test", 2.5)))

      Okay, this is just starting to look like LISP now. If I wanted to code LISP, I knew where to find it.

    14. Re:print as function vs. keyword by Chapter80 · · Score: 1

      Instead of doing

      print "This used to work"

      You now have to do

      print("This is how 3.0 rolls")

      HOLY COW that's MAJOR! Imagine having to go through every program and having to add parentheses AND having to change your constants from "This used to work" to "This is how 3.0 rolls".

      Good thing they have the conversion program.

      PS, this is a non-story. Seriously, anyone who has followed Python for the past 3 years knows that Python 3000 (aka 3.0) was designed from the beginning to break a few things and fix a few known legacy issues.

    15. Re:print as function vs. keyword by julesh · · Score: 1

      Argh! I left off a trailing parenthesis!!!

      print (repr(("test", 2.5)))

      Okay, this is just starting to look like LISP now. If I wanted to code LISP, I knew where to find it. How about:

      >>> print (("test",2.5))
      ('test', 2.5)


      ?
    16. Re:print as function vs. keyword by Anonymous Coward · · Score: 0

      Python 2.6 will have a tool that will automatically convert these small syntactic changes, making 3.0 code from 2.6 code fairly painlessly. Also, 2.6 will warn about every piece of the language that can't be easily converted, giving developers plenty of lead time to update their code before 3.0.

    17. Re:print as function vs. keyword by Anonymous Coward · · Score: 0

      I really, Really, hope you're not writing code that depends on print returning a string instead of a tuple.

    18. Re:print as function vs. keyword by Breakfast+Pants · · Score: 1

      You happened to pick the one that that is almost entirely statically determinable, and hence can be translated automatically (I say almost because you could conceivably dynamically generate a string containing a print statement and then call eval on it).

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    19. Re:print as function vs. keyword by m50d · · Score: 1
      I hear this from lisp zealots all the time, but I really don't see it. Statements are useful because they make the distinction between things which need to occur sequentially and things which could be calculated at any time - which is an important one in the real world, something that pure-functional languages tend to be very bad at, and is only going to become more important with the rise of multicore machines.

      Making print a function is a sensible thing, I think, but it reveals a deeper flaw in python: a bare "function argument" ought to call the function with the argument, without needing brackets.

      --
      I am trolling
    20. Re:print as function vs. keyword by morgan_greywolf · · Score: 1

      duh. :-P

    21. Re:print as function vs. keyword by Anonymous Coward · · Score: 0

      That's the biggest incompatibility for now, just wait until they complete the standard library reorganization which afaik they're just starting.

  7. 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 dotancohen · · Score: 1

      sometimes you need to break with the past to develop solutions to problems Tell that to the kludge who wrote Vista.
      --
      It is dangerous to be right when the government is wrong.
    2. 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!
  8. 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.

    1. Re:We have options. by Anonymous Coward · · Score: 0

      Exactly. I remember a lot of hosts still allowing you to run your PHP through version 3 instead of version 4 years ago. Just as right now most hosts allow you to still run your PHP through version 4 instead of 5.

      This is news, yes, but not the sensationalistic drama people are making it out to be. In the end Python3 is probably heading in the right direction and they probably couldn't have done this without breaking compatibility.

    2. Re:We have options. by WetCat · · Score: 0

      A pity in this scenario is that your language flavor, not version, becomes "obsolete", "not modern" and then "out of support". Personally, I really hate to type
      print("lll")
      instead of
      print "lll"
      and this change will eventually will force me to type so, or drop the language.

    3. Re:We have options. by Anonymous Coward · · Score: 0

      Java may not be fashionable anymore, but if they did nothing else right, they did this. Java supports a deprecation facility. Not only can the compiler be told what version of Java source and object code to deal with, but even the classes and their contents can be marked as "not for new development" via the "@deprecated" Javadoc tag.

      Only those of us who've been paged in the middle of the night, developed a one-line code fix and then found we couldn't compile because all the currently-installed compilers and libraries aren't compatible with the source can fully appreciate what that means. It means that the compiler will yell at you for using obsolete features, but go ahead anyway, allowing you to go back to bed and worry about the actual upgrade during slow time instead of making a lot of panicky upgrade mods and hoping that the cure won't be worse than the disease.

      Then again, my REAL problem with Python is that thanks to late binding, the actual broken code won't be discovered until someone actually executes it. You get that "faster-to-production" high at the expense of all the early error checking that more rigid languages require.

    4. Re:We have options. by FunkyELF · · Score: 1

      Java may not be fashionable anymore, but if they did nothing else right, they did this. Java supports a deprecation facility. Not only can the compiler be told what version of Java source and object code to deal with, but even the classes and their contents can be marked as "not for new development" via the "@deprecated" Javadoc tag. Yeah, but even though they did that why when they introduced generics does an ArrayList still return an Object behind the scenes? Why not do it right if you can target different JVMs?
    5. Re:We have options. by rk · · Score: 1

      FYI, Python also has deprecation facilities to allow any code to raise a deprecation warning when something is planned to be removed.

      Then again, my REAL problem with Python is that thanks to late binding, the actual broken code won't be discovered until someone actually executes it. You get that "faster-to-production" high at the expense of all the early error checking that more rigid languages require.

      We could debate dynamic/static typing forever as it's quite the holy war (usually indicative that there's no real 'best, always right in every circumstance' answer), but surely you don't think it's a good idea for code to go into production without it being executed in some sort of test beyond "hey, it compiles!" first?

    6. Re:We have options. by Anonymous Coward · · Score: 0

      Sure, it's not a good idea. On the other hand, after fifteen years in the industry I don't think I've ever met anyone who achieved 100% path coverage in any project.

      But it could be worse. We also have languages like PHP, in which "foo" + "bar" evaulates to zero without so much as a warning. At least gaffes in Python tend not to be silent.

    7. Re:We have options. by tkinnun0 · · Score: 1

      Yeah, but even though they did that why when they introduced generics does an ArrayList still return an Object behind the scenes? Why not do it right if you can target different JVMs? Every Object has a getClass() method. What would carrying that information for every Object in every stack frame actually buy you?
    8. Re:We have options. by Raenex · · Score: 1

      Python isn't about "flavors", it's about "There should be one -- and preferably only one -- obvious way to do it." That means breaking the old way when it's decided that the new way is better.

  9. #1 way to prevent adoption of new language version by mmeister · · Score: 0, Flamebait

    This looks like a shoot yourself in the foot moment. I briefly read through the Py3K stuff and found it difficult to see what the true benefits were for creating this incompatibility. If they want to do this and have folks adopt it, they need to provide a COMPELLING SET OF REASONS for why they are making it incompatible.

    If you're going to make a language completely incompatible, you basically have created a NEW language.

  10. 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 Anonymous Coward · · Score: 0

      "Tell, me exactly what would satisfy you?"

      Ok, I tell: you exactly not satisfy me at all!

      (Sorry, my brain told my fingers to stop typing, and they wouldn't.)

    4. 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>
    5. Re:Whiners by Anonymous Coward · · Score: 0

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

      Are those pacifiers free as in speech, or free as in beer? Cuz, I won't suck on any pacifier that is encumbered by restrictive intellectual property laws, you know. I must be able to share and/or modify my pacifier in any way I see fit. Plus, it'd really be nice if you included some glow sticks with the pacifiers. It's fun to wave them around during the rave while sucking on my open designed pacifier.

    6. Re:Whiners by deanlandolt · · Score: 1

      Guido's Time Machine will cure what ails ya.

      I sense that I already know Py3K somehow.

    7. Re:Whiners by Jugalator · · Score: 1

      Although it was, that parent should not just have been modded "funny", but insightful too.

      It's an all too common fallacy in discussions to assume people are constantly changing their minds, when the many minds may actually often be decided from the start, just that there are many opinions.

      I just recently heard it all the time with a recent game release. People complained on that it was taking so long to get done, and then people complained that it had bugs on its release date and was rushed. Some others then inevitably stepped in and went "But make up your minds, people!" Bzzzt!

      It's really kind of surprising how often it happens when you start thinking about it.

      --
      Beware: In C++, your friends can see your privates!
    8. Re:Whiners by Anonymous Coward · · Score: 0

      +5 Insightful? Wow...

    9. Re:Whiners by Anonymous Coward · · Score: 1, Interesting

      It's not the same thing at all. When companies remove compatibility, you're SOL. When free software removes compatibility, I can still run the old version, or port the old version to a new OS, or hire somebody to do that for me.

      If companies did the equivalent thing -- "the new version won't be backwards-compatible, but we're open-sourcing the old version" -- I don't think anybody would complain.

    10. Re:Whiners by Junior+J.+Junior+III · · Score: 1

      Write it once, write it right. Make it perfect and future proof the first time. That'd satisfy everyone

      --
      You see? You see? Your stupid minds! Stupid! Stupid!
  11. Sad day by DJ+Jones · · Score: 0, Troll

    They really went the Microsoft route on this one.

    1. 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.
    2. Re:Sad day by BrentH · · Score: 1

      The reason that MS bends over backwards for backwards compatibility is that that's the only reason for using it's software: slews and slews of 3rd party apps that users have grown accustomed to. If they'd take that away, there's no sense in sticking with Microsoft: everyone could jump ship to Linux/OSX.

  12. 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
  13. Sounds interesting by JoeCommodore · · Score: 1

    Sounds like they are definitely going for a version 3 of the language. They have identified what they need to fix and add to version 2 and are going to implement it in version 3. I have messed with python so I don't have a heavy code investment in it yet but either way - if it makes Python better than it is, I think its worth considering.

    --
    "Enjoy what you're doing! If it becomes drudgery, you're doing it wrong!" - Jim Butterfield
  14. So long... by corychristison · · Score: 1

    ... as I can have them installed side-by-side. Perhaps make the executable python3 or something to use different shebang lines (#!/usr/bin/python and #!/usr/bin/python3). If I recall correctly most OS's use a symlink python to the version anyway.

    Would make the transition easier for everybody. My OS of choice (Gentoo) uses Python as the distribution method.

    1. Re:So long... by Anonymous Coward · · Score: 0

      My OS of choice (Gentoo) uses Python as the distribution method.

      I wonder if Gentoo will allow you to have a (non-core) python module installed for multiple versions of python at the same time by the time 3.0 is out?
    2. Re:So long... by ceoyoyo · · Score: 1

      On OS X I frequently have several versions of Python installed. There's the system Python, which you try not touch, then there's the user installed Python framework, into which you can put as many versions as you want. As you say, you can select which one you want using a direct path to the executable in the framework or you can use symlinks. Packaged apps carry around their own interpreter so they're not affected no matter what stunts your users pull.

  15. Version 3.0 of EVERYTHING should be rewritten by $RANDOMLUSER · · Score: 1

    I applaud these guys for having the balls to say "I'm going to take what I've learned from the mistakes I made in versions 1 and 2, and start over with something better". I love Java, but I sure wish some of the 1.1 and 1.2 cruft would go away.

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
    1. Re:Version 3.0 of EVERYTHING should be rewritten by Ambidisastrous · · Score: 1

      Some things need it, some things don't. For languages, it really helps to clean up old cruft to make the language more consistent, and sometimes it makes compilation easier by getting rid of awkward special cases. Ruby took the approach of making the crazier additions in 1.9, so that 2.0 will be able to decide what's worth keeping (which I think means they'll throw some cruft way too). Even C cleaned things up a little in the C99 spec. These definitely aren't full rewrites, though, like Perl 6.

      For compilers and interpreters it's a little different. They can complain loudly when they run across a deprecated feature, but usually there needs to be some way to run older code. I know I often see a few warnings when compiling some apparently stable library, but I still want it to compile. GTK2 still handles a ton of deprecated stuff from the GTK1 days.

      I draw the (blurry) line between features and infrastructure: A Firefox extension can change completely whenever it wants; Firefox itself hurts a little when it changes, but mostly just while the extensions get sorted out; and Gecko still needs to be able to handle HTML 1.0.

  16. 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
    1. Re:Python is doomed by Anonymous Coward · · Score: 0

      C++ isn't mainstream? Where have you been the last 10 years? Tons of code is written in C++ including large parts of Windows, Qt and wxPython to mention a few. If it has to be fast and maintainable you use C++.

    2. Re:Python is doomed by cbart387 · · Score: 1

      I was under the distinct impression that what you write in C can be compiled as C++. Can you give a specific example of where this isn't the case?

      --
      Lack of planning on your part does not constitute an emergency on mine.
    3. Re:Python is doomed by cbart387 · · Score: 1

      Sorry, I should say that you can link object files (from C) and call C functions from C++. I'm not aware of you can compile C as C++ 100%.

      --
      Lack of planning on your part does not constitute an emergency on mine.
    4. Re:Python is doomed by itsdapead · · Score: 1

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

      Two differences:

      1. C++ ain't C version 2. is a new language that happened to have some backwards compatibility with C.
      2. C/C++ is (...er, reads point one..) ^H^H are compiled language! Practical upshot: if you install a C++ compiler it won't instantly stop all C-derived binaries on your system from working; and you don't have to persuade your users to install C++ in order to run your latest code.

      So does Python 3 also sacrifice backward compatibility with Makefile and FORTRAN, or does it still use whitespace as syntax? :->

      --
      In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
    5. Re:Python is doomed by SuperQ · · Score: 1

      Your sarcasm filter must be broken.

    6. Re:Python is doomed by Anonymous Coward · · Score: 0

      most C code, especially well written C code, is also legal C++ code (though not well written by C++ standards, which expect you to be exception safe, const-correct, use OO appropriately and inline functions rather than macros).

      The counter-example mentioned in the GP is

      char* p = malloc(N);

      which is legal in C but not in C++. C++ requires a cast in that statement. Of course C++ provides alternative allocators which give type safety and no cast.

      Another example is that C++ requires prototypes, C will create a default. But C code that uses defaulted declarations is poor practice anyway.

      So for all useful purposes C++ can compile C code.

      It sounds like this is partly the case for the python 2->3 transition, where a large proportion of the forced "new syntax" was already accepted and in fact preferred over the alternative.

    7. Re:Python is doomed by Drooling+Iguana · · Score: 1

      Look! Up in the sky! It's a bird, it's a plane, it's the joke!

      --
      ... I'm addicted to placebos
    8. Re:Python is doomed by Constantine+XVI · · Score: 1

      Not sure about C++, but ObjC compilers can compile all C code with no problem IIRC

      --
      "I think an etch-a-sketch with an ethernet port would beat IE7 in web standards compliance."
    9. Re:Python is doomed by Mad+Merlin · · Score: 1

      I'm not aware of you can compile C as C++ 100%.

      Almost, with a few exceptions, for example:

      $ cat c.c
      #include <stdio.h>

      int main(void)
      {
      int class = 3;
      printf("%d\n", class);

      return 0;
      }
      $ gcc c.c
      $ g++ c.c
      c.c: In function 'int main()':
      c.c:5: error: expected unqualified-id before '=' token
      c.c:6: error: expected primary-expression before 'class'
    10. Re:Python is doomed by cbart387 · · Score: 1

      Makes sense. I've always done casting in those situations, even when writing _for_ C.

      --
      Lack of planning on your part does not constitute an emergency on mine.
    11. Re:Python is doomed by cbart387 · · Score: 1

      Good example. You could easily fix a program like that by throwing in a '#define class something'. :)

      --
      Lack of planning on your part does not constitute an emergency on mine.
    12. Re:Python is doomed by dartboard · · Score: 1

      Wow, you're doing it wrong then. Adding unnecessary casts is a bad thing because it can mask serious typesafety issues.

    13. Re:Python is doomed by cbart387 · · Score: 1
      Could you elaborate on why the cast below is 'bad'?

      N being some integer
      char * p = (char *)malloc(sizeof(char)*N);
      --
      Lack of planning on your part does not constitute an emergency on mine.
    14. Re:Python is doomed by dasunt · · Score: 1

      I prefer this example:

      int main(void)
      {
      char a[3] = "foo";
      return 0;
      }

      That's valid C but invalid C++, as a quick test shows:

      [dasunt:/tmp/slashdot]$ gcc -std=c99 -Wall test.c
      test.c: In function 'main':
      test.c:3: warning: unused variable 'a'

      [dasunt:/tmp/slashdot]$ g++ -std=c++98 -Wall test.c
      test.c: In function 'int main()':
      test.c:3: error: initializer-string for array of chars is too long
      test.c:3: warning: unused variable 'a'
    15. Re:Python is doomed by dasunt · · Score: 1
    16. Re:Python is doomed by prockcore · · Score: 1

      It's not.. what he means is by doing a cast you're telling the compiler "I know what I'm doing". The result is the compiler won't spit out warnings that it might've otherwise.

    17. Re:Python is doomed by Anonymous Coward · · Score: 0

      They can call it Python=Python+1.

    18. Re:Python is doomed by Anonymous Coward · · Score: 0

      Apparently "foo" takes up four bytes including the terminating NUL byte.

      Who knows where the NUL byte is going to end up in?

      Of course it's up to you to give yourself potential buffer overflows, so while your example is valid C code syntactically, sane people wouldn't actually try to do it.

    19. Re:Python is doomed by cduffy · · Score: 1
      Neither of these points is compelling.

      C++ ain't C version 2. is a new language that happened to have some backwards compatibility with C.
      And Python 3 is what used to be known as "Python 3000" -- a different, mostly-backwards-compatible language that fixes any of Python's design decisions that couldn't be resolved while keeping compatibility.

      C/C++ is (...er, reads point one..) ^H^H are compiled language! Practical upshot: if you install a C++ compiler it won't instantly stop all C-derived binaries on your system from working; and you don't have to persuade your users to install C++ in order to run your latest code.
      Python allows multiple interpreters to be installed at the same time and for programs to specify the interpreter version they want to use. Linux distributions have been packaging it that way for years.
    20. Re:Python is doomed by itsdapead · · Score: 1

      that fixes any of Python's design decisions that couldn't be resolved while keeping compatibility.

      ...but which is clearly intended as a direct replacement for Python, developed by the same team, with the same general design goals and programming paradigms. C++ was (AFAIK) produced by a third party and layered a completely new and radical (to C programmers) programming paradigm on top of C. Not the same thing at all.

      (Python 2-to-3 sounds more analogous to the transition from K&R C to ANSI C than C to C++)

      (PS: remember we're talking about the nature and implications of the transition, not comparing C and Python - life is too short!)

      Python allows multiple interpreters to be installed at the same time and for programs to specify the interpreter version they want to use. Linux distributions have been packaging it that way for years.

      ...and that has to be set up, using exactly the same conventions, on every machine which will be running your code - not just the machine on which you write/compile the code. If you're writing for your own use, or have your own dedicated/virtual web server then fine. If its going to be deployed on independently-managed machines - possibly running third-party python apps - then its a headache. Not a deal-breaker, perhaps, but the sort of added complexity that will persuade, say, a commercial shared web-hosting service to stick with the old version (as happend with PHP5).

      --
      In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
    21. Re:Python is doomed by cduffy · · Score: 1

      ...but which is clearly intended as a direct replacement for Python, developed by the same team, with the same general design goals and programming paradigms. C++ was (AFAIK) produced by a third party and layered a completely new and radical (to C programmers) programming paradigm on top of C. Not the same thing at all.
      Yes, but... what's your point? Are you saying that C never should have gone from K&R to ANSI?

      ...and that has to be set up, using exactly the same conventions, on every machine which will be running your code
      And just like every Linux machine versions its libc libraries the same way, every Linux machine versions its Python interpreter the same way. The conventions on this are global -- so this really is every bit as moot as complaining about a libc upgrade with an incompatible ABI.
  17. 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. :)
    1. Re:Almost 2 years old? by Anonymous Coward · · Score: 0

      Final release is slated for August. (No infinite Perl 6 development.) Perl 6 development is not infinite. Just the date is not eh, finite, yet.
  18. 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.
  19. Python Version Hell by Doc+Ruby · · Score: 1

    Last year, both Ubuntu upgrades (from 0610 to 0704 and then to 0710) each sent me into Python version mishmash/compatibility hell. But at least they could be mixed together a little, to bootstrap back to a working installation.

    I wish these scripting languages were really just APIs, and could all be compiled to binary code instead of depending on different versions of different interpreters. The script source is just too transient without needing to be when working under the hood.

    --

    --
    make install -not war

    1. Re:Python Version Hell by nuzak · · Score: 1

      > I wish these scripting languages were really just APIs, and could all be compiled to binary code instead of depending on different versions of different interpreters.

      So basically, you're looking for .NET or Java or Parrot then. All three of 'em do run Python. Of course each of those is itself an interpreter...

      Python3000 had some pretty grand visions. Optional static typing. Generic functions. Look what we got: meaningless type annotations on functions, not even on locals. "Abstract Base Classes" which are similarly meaningless mixins and barely qualify as roles/traits. Oh yeah, print is a function now, and unicode is the default string type. Whoop de freakin do. I guess the incompatibilities warrant a major version bump, but it's a singularly unimpressive feature set for a modern language.

      --
      Done with slashdot, done with nerds, getting a life.
    2. Re:Python Version Hell by Doc+Ruby · · Score: 1

      How do I eliminate all the Python VMs and libraries from my system to instead run the Python scripts against only my single Perl installation? Even if I have to install a bunch of Perl modules to do it.

      But to really do waht I want, I'd need to actually compile those Python scripts in with the Perl executables, which I thought was too hard with autoloading and other dynamic runtime execution.

      The Perl scripts can stay interpreted. They've never caused me any version trouble yet. Though I wish every CPAN download were available through APT in a .deb package, instead of (perl -MCPAN) .

      --

      --
      make install -not war

  20. Well... by Anonymous Coward · · Score: 0

    This was bound to happen eventually. Legacy compatibility eventually becomes too cumbersome to maintain along with the new standard. This happens in all areas of technology, something new and better comes along, and eventually, the old tech is replaced. Backwards compatibility is nice, but not every developer wants to maintain compatibility with old standards.

  21. Following Microsoft's example? by bogaboga · · Score: 1

    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.

    I'd like to hear from slashdotters who used to blame Microsoft when Microsoft release software that broke backwards compatibility with existing versions. Is Python's development team following Microsoft's lead here?

    1. Re:Following Microsoft's example? by 644bd346996 · · Score: 1

      Is Python's development team following Microsoft's lead here? No. When creating new platforms, it is inevitable that nobody will get it right on the first try, and that flaws will be found as people try to do new things with it. The similarities stop there. Microsoft frequently doesn't even try to fix fundamental design flaws until after they release the software into the wild and let it fester for a few years. Python, on the other hand, was designed from the start to be a readable and easy to use language, and evidently with considerably more care than many of Microsoft's more notorious kludges. It's a trade-off for sure, but obviously one that appeals to most hacker types.
    2. Re:Following Microsoft's example? by heffrey · · Score: 0

      When do MS release software that breaks backwards compatibility?

    3. Re:Following Microsoft's example? by Dh2000 · · Score: 1

      The difference is: You are not forced to upgrade all your python applications, and both 2.x and 3.x will work side-by-side. Microsoft gets a lot flak for breaking third-party apps with new OS releases, but not so much when they release a new IDE.

  22. 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
    1. Re:Not news in any way by Wiseman1024 · · Score: 1

      Finally, somebody realized this article is !news .

      --
      I was about to say 13256278887989457651018865901401704640, but it appears this number is private property.
    2. Re:Not news in any way by Anonymous Coward · · Score: 0

      Don't you mean donkey's?
      shortened form of donkey's ears rhymes with years...
      donkey's == years

    3. Re:Not news in any way by Bogtha · · Score: 1

      No, "donkey's" is just an abbreviated form of the phrase "donkey's years". More information on phrases.org.uk.

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

    1. Re:philosophy by Caesar+Tjalbo · · Score: 0

      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.
      My install of sidux (based on Debian sid) has still Python 2.4.4 as default since 2.5 is still considered a problem by the Debian maintainers afaik. And I know more differences between 2.4 and 2.5 than I wish so a compatibility issue with 3.0 wasn't any news, even if it hadn't been announced years ago. I expect compatibility issues with 2.6 too and I'm sure the PEP for Python 4000 will be written soon after Python 3 stabilizes.
      With Python it's manageble though, I don't consider it a big problem. Plenty of code to go through but with a symlink here and a shebang there as bandaids it won't cost me more than a week to make my code 2.6 and 3.0 ready next to 2.4 and 2.5.
      --
      "I'm not much interested in interoperability. I want substitutability. I want to be able to throw your software out."
    2. Re:philosophy by tal197 · · Score: 1

      Python source is generally compatible (go another level deeper and you'll find that the .py files are mostly symlinks to a single copy, at least on Debian-type systems).

      However, the compiled .pyc files need to be regenerated for each version, which explains the separate directories. The symlinks are a messy hack, resulting from the fact that Python requires the .pyc files to go in the same directory as the corresponding .py files, even though you need multiple .pyc files for each .py file. If Python could cache the .pyc files somewhere else, the mess could go away.

      The main problem with Python compatibility is with the C ABI, which varies across different packages, making it impractical to use Python to add scripting to a C program, for example:

      http://www.mail-archive.com/python-3000@python.org/msg09051.html

    3. Re:philosophy by Anonymous Coward · · Score: 0

      Poster says:
      IIRC, even dot-releases of python are not source-compatible.
      --
      There may have been some issues, but dot-realeases of Python are almost entirely compatible.

      I worked on a project with ~150K lines of Python that went from Python 2.2 to 2.3 to 2.4 with
      no code changes.

    4. Re:philosophy by bitMonster · · Score: 1

      Huh?

      I think that's just the way it is packaged by the distros. It's much easier for them to just put in the whole standard library that is shipped with a particular version instead of trying to figure out exactly what changed if anything. So, I think you have gotten the wrong impression about their philosophy.

      I routinely upgrade to newer versions of python without changing our old code. I also use third-party code that was written several years ago for old versions of python without modifications on 2.4 and 2.5.

      -Jeff

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

  26. 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
  27. All for it. by misleb · · Score: 1

    While I'm not much of a Python programmer, it is refreshing to see projects are are not afraid to risk breaking compatibility in the name of progress and getting rid of legacy cruft. One thing I noticed about Python the few times I tried it was that there seemed to be a lot of ways (many of them officially "obsolete") of doing the same thing. One bit of confusion I recall is trying to call the "super" method of a parent class when you've overridden a method. In my research I found several long articles about the pros and cons of different ways of doing it and I just got more confused.

    Compatibility is often overvalued and tends to add needless complexity and bloat. Just look at Windows.

    --
    "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    1. Re:All for it. by Anonymous Coward · · Score: 0

      quite right, you let your stuff stagnate and you end up with a bloated mess. I really hate that I have to mention Windows here, but look at OSX Leopard? Can you even use OS9 stuff any more? Then look at vista, which runs SimCity95 natively, but at what cost! i'll do myself the favor of posting anonymously because I know full well this has been said 9 or 10 times already.

  28. Damn right by Anonymous Coward · · Score: 0

    The reason I use Python is that I used to use Visual Basic and Microsoft borked me by creating a backwards incompatible version (somewhere around ver. 2 iirc). I have written a lot of python script. The idea of having to fix it all ... it ain't going to happen.

    If they change the extension, we can still use our old code with an old installed version of Python. What worries me is that Ubuntu does all these updates. That means that someday, without warning, my Python scripts won't work any more.

    1. 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.
    2. Re:Damn right by SQLGuru · · Score: 1

      I know in Windows you can associate an extension any way you want, so I asssume Linux can too......just make your own extension (.py26) and associate it with the older install of Python. A quick little shell script should go through and rename all of the files and *then*, when Python gets updated or when you get a script from someone else, you don't have to worry about it.....your stuff should continue to hummm along until you get around to fixing the incompatibilities (or someone writes a program to fix it for you).

      Layne

    3. Re:Damn right by lazy_playboy · · Score: 1

      The usual way of telling a linux system which interpreter to use is the 'hash bang' in the first line of the script. So for python you'd use #!/usr/bin/python, or as a previous poster suggested to prevent incompatibility, #!/usr/bin/python2.6. For perl, something like #!/usr/bin/perl is used and the same system is used for bash scripts.

      It prevents all the silliness with file extension associations ;-) It's customary to use .py or .pl with python or perl scripts but it's not necessary.

    4. Re:Damn right by CaptDeuce · · Score: 1

      So put #!/usr/bin/python2.6 or whatever in your scripts

      How about making the "whatever" look like '#!python:v2.6' instead? Full pathnames are ludicrously fragile and have been long overdue for retirement. To wit:

      "Dude, I keep my cash stashed in my mattress."

      "No way, man, I use my underwear drawer."

      "Pshaw! You losers are both, like, totally lame. I keep mine in my underwear.

      --
      "Where's my other sock?" - A. Einstein
    5. Re:Damn right by morgan_greywolf · · Score: 1

      Or does Ubuntu launch things based on file extensions? Yes and no. Nautilus and bash both honor a '#!/usr/bin/foo'
    6. 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
    7. Re:Damn right by Anonymous Coward · · Score: 0

      What worries me is that Ubuntu does all these updates. That means that someday, without warning, my Python scripts won't work any more. Right, because Ubuntu is the OS that pushes updates without warning or the chance to decline.
    8. Re:Damn right by Sillygates · · Score: 1

      Or does Ubuntu launch things based on file extensions? Actually, when you exec() a program, the kernel finds the magic number corresponding to "#!", and executes the given interpreter with the script name as an argument.

      So basically, the answer is: every linux distribution does it.

      Ans most other systems (BSD/MacOS/etc), other than windows, do it too.
      --
      I fear the Y2038 bug
    9. Re:Damn right by Wheat · · Score: 1

      #!python:v2.6

      That would be:

      #!/usr/bin/env python

      Or if you want to specify 2.6 only:

      #!/usr/bin/env python2.6

      Then your application just needs to take care to supply it's own enivronment:

      export PATH=/path/to/buildspace/python-2.5.1/bin/:$PATH

      Or you can do:

      #!/Users/kteague/python/2.4.4/bin/python

      import sys
      sys.path[0:0] = [
          '/Users/kteague/buildouts/my-project/src/',
          '/Users/kteague/buildouts/shared/eggs/zdaemon-2.0.0-py2.4.egg', ..., ...,
      ]

      And declare a hard-location to your interpreter and every additional library location or egg that you depend upon. Python has tools such as zc.buildout that make it easy to specify the parts (and versions) that your application requires to run. Then a build tool can be used to deploy an explicit set of PATHs to any location on your system. This gives you the best of both worlds, as everything is explicit, but if you move things, upgrade, switch operating systems, etc, then you can just re-run your build recipe to re-create a working application.

    10. Re:Damn right by Ambidisastrous · · Score: 1

      In Linux there are a few ways to do it, depending on how your system is set up.

      A. If you have Python 2.6 installed at /usr/bin/python (the usual spot), make sure the environmental variable for python is pointing to that. The "portable" way to do the shebang is #!/usr/bin/env python, so if /usr/bin/env python points to python2.6, you're fine. If you want to run Python 3.0 by default, make /usr/bin/env python point to python3.0.

      B. If you want to play with Python 3.0 without clobbering Python 2.6, install Py3.0 to another location like your home directory. Put #!/usr/bin/env python3.0 at the top of your scripts, or run them from the terminal as python3.0 myscript.py.

      C. If you have Py3.0 as the default (/usr/bin/env python), and you want to run a certain script as Py2.6, use python2.6 myscript.py from the shell or #!/usr/bin/env python2.6 at the top of the script.

      D. If you're lazy, #!python3.0 and #!python2.6 also usually work without the /usr/bin/env.

      But as they say in a bunch of other places, you can keep writing 2.6-compatible scripts and using the built-in 2to3 converter to generate 100% 3.0-friendly equivalents until you're ready to make the switch.

      (In Linux, the file type is normally figured out from the contents of the file, particularly the first two bytes, instead of the extension. Some window managers will look at the extensions, too, but they'll still figure it out if you have a GIF file that happens to end in .jpg (for example).)

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

    12. Re:Damn right by Anonymous Coward · · Score: 0

      to supply it's own enivronment

      "its".

  29. Old news by Yvanhoe · · Score: 1

    Python 3000 (the draft for Python 3) has been in the works since 2006 and it has quickly been made quite clear that backward compatibility would be broken.

    Well I guess old news is better than no news at all...

    --
    The Wise adapts himself to the world. The Fool adapts the world to himself. Therefore, all progress depends on the Fool.
  30. So python is now dead? by guysmilee · · Score: 1

    Why would anyone consider even using python for the next few years ... sounds like someone just killed python to me!

    1. Re:So python is now dead? by Anonymous Coward · · Score: 0

      Yes, you stop using Python, and we'll let you know when it is safe again.

    2. Re:So python is now dead? by Marcion · · Score: 1

      There is a clear and well defined path. Continue to write code against the two series (2.5, 2.6, and so on) until the whole world has moved to 3.0.

      During this time, an automated tool will provide a 3.0 version of your 2.6 code. Don't edit the 3.0 code but instead keep adding the changes to the 2.6 version and regenerate the 3.0 code.

    3. Re:So python is now dead? by Anonymous Coward · · Score: 0

      Since you obviously don't use Python now (this wouldn't be news if you did), what difference does it make if it's dead to you?

    4. Re:So python is now dead? by DragonWriter · · Score: 1

      Why would anyone consider even using python for the next few years ... sounds like someone just killed python to me!


      Uh, why?

      Its not like the 2.x branch is stopped, or as if their isn't an automatic transition tool. And its not like Perl6 and Ruby 1.9 aren't also backward-incompatible releases, too. (Perl6 likewise has a conversion tool.) Progress sometimes means abandoning some backwards-compatibility.

  31. Re:So, will it FINALLY have block structures? by Surt · · Score: 1

    No, sadly, they aren't fixing any of the key problems with the language, they're just not maintaining compatibility. Should be pretty much the death knell for python. I guess ruby wins.

    --
    "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  32. Re:So, will it FINALLY have block structures? by timster · · Score: 1

    Are you doing serious programming in Python with an editor that doesn't understand Python's block style? For that matter, when you do copy/paste with your C++ code, are you saying you don't bother to fix the indentation?

    --
    I have seen the future, and it is inconvenient.
  33. 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.

  34. Re:Use by Anonymous Coward · · Score: 0

    Good idea. It hasn't changed in 80 years.

  35. Re:So, will it FINALLY have block structures? by nweaver · · Score: 1

    I'm saying the editor fixes the indentation for you.

    Have you ever used LISP? The editor reads the parenthesis, you read the indentation.

    Indentation is a derived piece of structure, but should never have semantic meaning in a language except as a separator. Anytime you do so you ask for problems, both for editors, for code generators, and for users.

    --
    Test your net with Netalyzr
  36. White semantics make plenty of sense, young buck by TheCouchPotatoFamine · · Score: 1

    (young buck, slashdot id's not withstanding :))

    Whitespace Scoping and Block Scoping are two end of a dichotomy. Before you go wishin' it wasn't this way, well, i'm not going to belabor it but some of us like to actually be able to scan code without having to inspect every darn character to figure out where things start and end. It actually takes brain cycles to do that that could be spent on comprehension instead of syntactical flukery. It's a psychology thing not unlike the HID guideline (hid? in code? you betcha!)

    If you doubt still, perhaps this will sate you instead: it is a five line perl script (i misplaced it) to convert whitespace indenting to block indenting. They ARE identical and can be translated between freely. Whitespace indented perl? You Betcha!! "Curly" python? Sure! If it bothers you, go write that script and get outta da way :)

    best, and truthfully!

    --
    CS majors know the time/space tradeoff, but they never get taught the 3rd, crucial, tradeoff of the set: comprehension!
  37. 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 adisakp · · Score: 1

      you do realize you can say "fuck" on Slashdot, right? Watch: Fuck, fuck, fuck, fuck. It's pretty cool

      Depends on who has mod points that day. I once got modded down to "-1 flamebait" for pointing out that RTFM means "Read The Fucking Manual" as opposed to "Read The Fine Manual" which appeared in a linked article. I'm sure if the creators of RTFM thought the manual was "fine", they'd be saying RTFFM anyhow :)

    2. 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.
    3. 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.
    4. Re:It does have block statements. by Virak · · Score: 1

      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.

      Sorry, I should've been more clear on this. I meant automatically indenting as you type, not automatically indenting an existing file. (Though you *can* automatically indent a Python file, in much the same way you can automatically add or remove braces in some cases in languages that use them. It's not a very useful operation in either case since all you can really do with it is use it to standardize on a single style for code, but it's possible.)

      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.

      If something destroys the delimiters for some reason, you're just as fucked as you'd be in Python if you lost your indentation. (To be fair, this doesn't happen as often as losing indentation. (To be fair, the most common reason for loss of indentation is by far putting it in HTML without using an element that doesn't collapse runs of whitespace, in which case it's your own damn fault.))

      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.

      It's no more burdensome than the automatic indentation you'd have to apply in a language that uses braces (at least, assuming you're using a decent editor). In vim, all I need to do to indent pasted code is use ]p instead of p or [p instead of P when I paste it, and it automatically gets adjusted to the current indentation level. That's a single extra key stroke, which you'd at least need to tell it to indent the code appropriately for you with other languages. (Of course, you could tell it to automatically indent the file whenever you paste text, but that's not a good idea for various reasons)
    5. Re:It does have block statements. by DragonWriter · · Score: 1

      Sorry, I should've been more clear on this. I meant automatically indenting as you type, not automatically indenting an existing file.


      But Python doesn't allow an editor to automatically correctly indent as you type, either; all an editor can give you is the most-likely indentation point (the last line's indentation normally, one indent level in if you use an "if [...]:" or some similar statement that introduces a block.) With a language that has an unambiguous block structure defined by delimiters, the editor can correctly indent as you type, not merely give you the most likely indentation. The effects are superficially similar, but not the same.

      It's no more burdensome than the automatic indentation you'd have to apply in a language that uses braces (at least, assuming you're using a decent editor). In vim, all I need to do to indent pasted code is use ]p instead of p or [p instead of P when I paste it, and it automatically gets adjusted to the current indentation level. That's a single extra key stroke, which you'd at least need to tell it to indent the code appropriately for you with other languages.


      Yes, if you happen to want to insert the pasted text at the current indentation level. Which you may or may not. Because the same text could be pasted at different indentation levels and still be legitimate code (with different meanings), the general case is that you have to do that, and then sometimes adjust by one indentation level in one direction or the other (most likely, if an adjustment is needed, it will be one level out.)

      With a language whose block structure is carried by delimiters, as long as you copy the right source code (including the beginning and/or ending delimiters, as appropriate), its always simply an "autoindent" on the region and you are in the right place. With Python, the source code copied doesn't carry enough information to unambiguously determine the correct indentation level, so its not possible to have a one-step, always-correct mechanism to correct the indentation.
  38. Re:So, will it FINALLY have block structures? by Hatta · · Score: 1

    You can have C code auto-indent with no problems, because even if it does it wrong it doesn't matter. Since Python's whitespace is semantic auto-indent would change the meaning of the code, which should never ever happen.

    --
    Give me Classic Slashdot or give me death!
  39. Great timing! by somegeekynick · · Score: 1

    A couple of tabs away, I have the Python Docs/Tutorial page open learning about keyword arguments. Would have I to learn everything over again in a year?

    1. Re:Great timing! by msuarezalvarez · · Score: 1

      The answer is simple: no.

  40. Re:White semantics make plenty of sense, young buc by Hatta · · Score: 1

    Whitespace indented perl? You Betcha!! "Curly" python? Sure! If it bothers you, go write that script and get outta da way :)

    Really? I can write python without thinking about indentation and whitespace, run it through an auto-indenter when I'm done and have it work correctly? How?

    --
    Give me Classic Slashdot or give me death!
  41. It's not just incompatible... by ameline · · Score: 1

    It's not just incompatible -- it's also 33% slower.

    And if you order today, you'll also get a nice pile of shiny new bugs for only the cost of shipping and handling.
    Don't wait! Call now!
    The first 100 callers will also receive a free kick to the testicles.

    --
    Ian Ameline
    1. Re:It's not just incompatible... by Ragzouken · · Score: 1

      I was as shocked as you when I heard the alpha version of python 3000 wasn't perfect!

    2. Re:It's not just incompatible... by Anonymous Coward · · Score: 0

      It's not just incompatible -- it's also 33% slower.
      So it's still hundreds of times faster than Ruby?
  42. Re:Use by Anonymous Coward · · Score: 1, Insightful

    It's called Perl 6, and it's THREE TIMES as almost-here* as Mystery Science Python 3000.

    * Parrot, Haskell and Common Lisp

  43. 15 lines? by Anonymous Coward · · Score: 0

    ...or you could do that with a Perl oneliner ;)

    Provided you've got a wide terminal, of course.

  44. 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
  45. Smoothing out the wrinkles by steveha · · Score: 1

    Python is already a very smooth language, but there are a few corners where it could be better. The Python guys are taking this chance to smooth out the wrinkles.

    For example, Python 2.x has both range() and xrange(), and the only difference is that range() actually builds a list and xrange() doesn't (it returns an iterable object that can be expanded into a list if you like, or just used in a for loop or whatever). There is no real need to have both range() and xrange(), so Python 3.x will simply have range() and it will return an iterator. More generally, all the Python features that return a list in 2.x will now return an iterator, and the special variants that return iterators will vanish.

    There are many other changes but that one is representative. There is nothing here as dramatic as the changes from Perl 5 to Perl 6. Also, there is a nifty automated tool to help migrate Python 2.6 programs to Python 3.0 programs. There is no huge controversy here, sensational headlines notwithstanding.

    I predict that the Python community will embrace Python 3.x when it's available. Python 2.x won't vanish instantly, but people will want to migrate to the new Python, and certainly schools using Python to teach will want to start using Python 3.0 immediately.

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
  46. 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.
    1. Re:Python takes a step backwards. by Anonymous Coward · · Score: 0

      One guy is trying to implement a hard-code compiler for Python

      I do not think this word means what you think it means.
    2. Re:Python takes a step backwards. by Ambidisastrous · · Score: 1

      The approach to parameter typing (optional and unenforced) is silly. Having it and not enforcing it is just asking for trouble.

      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. I think the language you're looking for is here.

      It's not optional parameter typing, it's parameter annotation. Libraries can figure out something useful to do with them, e.g. documentation generators or FFIs, but the language by default doesn't care. Usually the annotations won't be used. Declared types are certainly not the way Python intends to go.

      * 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. Prior to Python 2.2 (I think), there were "classic-style" classes that were, well, just ordinary classes. Dynamic structures. Python then introduced "new-style" classes that all implicitly derived from object. We've known since Smalltalk that it's useful for "everything" to be "an object", but Python didn't get around to implementing that properly until to 2.x series, and then had to keep old-style classes around for compatibility. Python 3.0 finally gets it right and eliminates old-style classes, so everything will in fact be an object. What you're looking for is something like "Object" and "StaticObject". So if you happen to derive from a StaticObject instead of an Object, you'll be surprised to find you're limited in the things you can do, and your options are to hack a dictionary onto your new object, or reimplement the parent class as an Object. Eventually you clue up and rewrite everything as an Object. The whole motivation of dynamically typed languages is that flexibility beats performance.

      The point of monkeypatching is that the original class definition didn't expect to be modified. So, why would expect that the author knows when deriving from Object is necessary instead of DynamicObject? It's the fragile base class problem, squared.

      * 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. Or you could take the approach that variables don't have types; values do. In which case the restriction is silly. Common Lisp takes this approach, and programs compiled with SBCL are about the same speed as Java.

      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. I think the language you're looking for is here.
    3. Re:Python takes a step backwards. by ben+there... · · Score: 1

      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. Or the more popular Psyco, a JIT C-compiler for Python, which boasts "2-100x speedups (typically 4x)", without modifying your code.

      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". Well, it sounds like that has issue has mostly been solved. PyPy uses "RPython", a restricted subset of CPython. It "compiles" Python code to C, LLVM, .Net CLI, and Java JVM. It might be interesting to note that the author of Pysco has joined the PyPy project and focused all his optimization efforts on that, as a more generalized implementation of Psyco's goals.
  47. so who's going to write the conversion tool $$$? by petes_PoV · · Score: 0, Troll
    Is this how someone will make money out of free software?

    It looks like there's an opportunity out there - depending on how much people value their time at, or how much companies are prepared to pay to assure their code base. You never know, there may even be some value in having your Python code V3 certified?

    --
    politicians are like babies' nappies: they should both be changed regularly and for the same reasons
  48. Re:White semantics make plenty of sense, young buc by debatem1 · · Score: 1

    Just the same way that I can write C++ without using any curly braces or semicolons.
    Since the two use BNF form, just write your code with curly braces then write a script to indent on a { and de-indent on a } and strip those characters. Pretty trivial really.
    Or you could just learn to write Python instead of whining about how it isn't C++.

  49. Use __future__ by Killer+Eye · · Score: 1

    Posters here do not seem to be aware of Python's __future__ module. It is the mechanism by which scripts can gracefully move forward before the rug is pulled out from under them. This is not unique to 3.0.

    The whole idea is that Python can add features to the language in __future__, that are available at least one version before they become the new default. A script can adopt a new feature ahead of time (e.g. "from __future__ import with_statement").

    It wouldn't surprise me if Python 2.6 has __future__ entries for Python 3.0 capabilities.

    --
    "Microsoft killed my company, I hold a personal grudge. I don't use Microsoft products and neither should you."-JWZ
    1. Re:Use __future__ by Tacvek · · Score: 1

      Posters here do not seem to be aware of Python's __future__ module. It is the mechanism by which scripts can gracefully move forward before the rug is pulled out from under them. This is not unique to 3.0.

      The whole idea is that Python can add features to the language in __future__, that are available at least one version before they become the new default. A script can adopt a new feature ahead of time (e.g. "from __future__ import with_statement").

      It wouldn't surprise me if Python 2.6 has __future__ entries for Python 3.0 capabilities. You are correct. Just about all of the useful new features in 3.0 that can reasonably be implemented with __future__ imports will be available in 2.6. This is intended to greatly assist the ease of transitioning to 3.0, which will takes years, but we already knew that.
      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
  50. Re:White semantics make plenty of sense, young buc by Justus · · Score: 1

    Really? I can write python without thinking about indentation and whitespace, run it through an auto-indenter when I'm done and have it work correctly? How?

    I believe his point was that you could write Python without thinking about indentation and whitespace, but you would have to use curly braces instead to denote blocks. Then the auto-indenter would just parse the blocks and indent appropriately for the language.

    As to whether or not that's feasible, I don't know—I'm not a Python programmer—but it sounds reasonable on the surface.

  51. In the good 'ol days by HangingChad · · Score: 0, Troll

    Back in the day we had to count on MS to roll out new versions of languages that would require expensive re-writes of systems working perfectly well on the old platform.

    Nice to see OSS getting into the act. Developers, developers, developers, developers...(insert monkey dance here).

    --
    That's our life, the big wheel of shit. - The Fat Man, Blue Tango Salvage
  52. 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?

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

  54. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 1

    What makes you think you cannot have python code auto-indented without changing the semantics?

  55. 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.
  56. Re:Use by jellomizer · · Score: 1

    Because no one can read the code to change it.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  57. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 0

    Hello, my name is Smalltalk. I am a language that actually is designed correctly and works. Thank you for poorly coping my features.

  58. 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 CastrTroy · · Score: 1

      I believe that in the earlier versions of VB there was an option to allow you to set whether or not you're arrays were 0 based or 1 based. Either way, when you defined your array with "Dim MyArray(6) as Integer" you were specifying that the maximum index was 6, regardless of whether or not it was 0 based. When you're not used to this notation, it can be a little confusing, but I program quite a bit in vb.net, and don't find it to be a problem.

      Also, with logical operators, it's sometimes nice to have it not short circuit all the time. Again once you get used to it, it feels quite natural to use each one at the appropriate time.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    6. Re:Breaking backwards comp. in languages good by shutdown+-p+now · · Score: 1

      "And" and "Or" are the bitwise operators, equivalent to C#'s "&" and "|". "AndAlso" and "OrElse" are the logical operators, equivalent to "&&" and "||".
      This is not entirely correct. Neither And/Or in VB.NET, nor & and | in C#, are strictly bitwise operators. They are only bitwise if operands are integral types or enums. For booleans, they are perfectly normal boolean operators, except that they do not short-circuit.
    7. 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).

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

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

    10. Re:Breaking backwards comp. in languages good by epine · · Score: 1

      APL had a global system variable known as "quad IO" (the quad was written as a tall medium-wide box symbol) which controlled "index origin". All sane programmers soon set this value to zero.

      If you had to sane functions with insane functions, you declared quad-IO in your list of local variables and assigned it the value assumed by the code within that function. Exiting that function, the local quad-IO would cease to mask the global quad-IO.

      We're probably talking late 1960s here.

      I'm not sure the first language to standardize on short circuit evaluation. The first I knew of was C. But then C didn't manage to get malloc (0) right, so even the best of us refuse to learn from our forebears.

      Of course, VB raised hearing impairment to the level of an art form, but not in the way Beethoven managed to write his ninth symphony. More like a John Cage requiem set to the lyrics "Don't worry, be happy".

    11. Re:Breaking backwards comp. in languages good by sydneyfong · · Score: 1

      Well VB.NET is already drastically different from VB6. If you introduced even more incompatible changes you might as well call it.... C#?

      --
      Don't quote me on this.
    12. Re:Breaking backwards comp. in languages good by Wiseman1024 · · Score: 1

      No, it's some horrible thing that Microsoft as well of others use.

      --
      I was about to say 13256278887989457651018865901401704640, but it appears this number is private property.
    13. Re:Breaking backwards comp. in languages good by Anonymous Coward · · Score: 0

      You're completely wrong about Arrays and VB.Net. It's VB classic where
      Dim SomeArray(5)
      gives you 6 elements from 0 to 5. And then this early Kludge:
      Option Base 1
      Dim SomeArray(5)
      gives you a 5 element array with elements from 1 to 5.

      VB.Net fixes this.

    14. Re:Breaking backwards comp. in languages good by syousef · · Score: 1

      VB.NET should never have been named VB anything. It's not VB, it just has similar syntax. The mistakes they made stemmed from trying to make it sound like it would be an easy move from VB6. Marketing overruling engineering again.

      --
      These posts express my own personal views, not those of my employer
    15. Re:Breaking backwards comp. in languages good by Your.Master · · Score: 1

      I don't think he was incorrect. It seems to me that when speaking of booleans, in terms of return value, logical and bitwise operators are functionally equivalent. Of course, bitwise operations are non-short-circuiting in these languages by nature (it's hypothetically possible to have bitwise short-circuiting but it seems like it would be no-gain at runtime, only if it could be detected at compile-time).

    16. Re:Breaking backwards comp. in languages good by shutdown+-p+now · · Score: 1

      It seems to me that when speaking of booleans, in terms of return value, logical and bitwise operators are functionally equivalent
      Depends on how the language defines binary representation of booleans. If it mandates that there is only a single bit in a boolean which is affected by the operators, then it is correct. But C++, for example, doesn't, so something like (~x & y) is not the same as (!x && y) for bools, because operator~ will flip all bits in the bool, the number of which is undefined, but no less than a byte. So, ~true != false in C++.
    17. Re:Breaking backwards comp. in languages good by finnw · · Score: 1

      It's more common than you might think. Java has & (not short-circuited, behaves as logical-and when applied to booleans) vs. &&, Eiffel has and vs. and then, Scheme has and? vs. and. The mistake is to make the non-short-circuited version effectively the default (by making it easier to type) since it is very rare that there is an advantage to using the non-short-circuited version. It's not as bad in java since many (i.e. former C programmers) are already accustomed to using && for logical-and.

      --
      Is Betteridge's Law of Headlines Correct?
    18. Re:Breaking backwards comp. in languages good by Anonymous Coward · · Score: 0

      You know what really annoys me about #1? When VB.Net was first released - the first beta (and I think the second) of what would become the VB.net 1.0 - arrays WERE declared with the same 'size' instead of 'highest element' - just like they are in C# and Java.

      Too many vb6 morons complained. MS changed to maintain compatibilty to get this very, very vocal but very stupid group alongside.

      (I have written code "Dim A As Integer(-1)". Yes, that is INSANE, but that's what you get with vocal idiots. You can still find their misguided websites..)

      The thing to remember is you declare the highest addressable element in the array; not the size of the array. Or just write code like Dim A As Integer() = DirectCast(New System.Array(TypeOf Integer, 10), Integer()).. (hopefully the type inference in 2008 makes this easier, and no doubt you could write a helper that uses generic type parameters to make this better.)

      Something like:

      Function CreateArray(Of T)(Size as Integer) As T()
                      Return DirectCast(Array.CreateInstance(GetType(T),Size), T())
      End Function

      (have no compiler, haven't checked that the code works or anything! "GetType(T)" might actually have to be "T.GetType()" instead)

      But you should be able to write "Dim A As Integer() = CreateArray(10)" or possibly "Dim A As Integer() = CreateArray(Of Integer)(10)" (can't remember how much it can automatically infer). 2008 should at least accept "Dim A = CreateArray(Of Integer)(10)" as it has type inference.

      Could be worse. They could have implemented Option Base.

      There are things I like in VB.Net over C# - named parameters being one of my favourites. (An aboulste MUST if you ever manually create a TimeSpan object!)

      (Although, I imagine the Python 3 compiler might have an "Option Python2" or the equilivant; I'm unfamilar with the language to know what the pythonesque way would be.)

    19. Re:Breaking backwards comp. in languages good by Anonymous Coward · · Score: 0

      I fail to see how the difference between "&" and "&&" is magically clearer than the difference between "And" and "AndAlso".
      When I see "AndAlso", I think "this, and also that".
      In other words, my natural assumption would be that both operands would be evaluated, no matter what.
      When I see "&&", the English language is not competing with the meaning of the operator, so there is no conflict of the type that there is with "AndAlso".

      If they had wanted to avoid this kind of confusion, they should have called the operators something like "AndMaybe" and "OrPossibly".
  59. Re:So, will it FINALLY have block structures? by nweaver · · Score: 1, Insightful

    Ah, I love the python defenders...

    Guys, block structured languages you can trivially derive pretty-printing formatting. Which means you get the "easy to read" ability trivially. You should NEVER read the Silly Parenthesis in LISP, that gets taken care of for you by any one of a gazillion tools.

    But you can't go the other way around.

    EG, on C, you can cut and paste trivially. You can't on python, you need an editor which parses the language sufficiently to understand that "This is a code block going into a different code block".

    Likewise, code generation. Its trivial to build a recursive code generator targeteing "pick your favorate block structure language". But in Python, you have to explicitly add a notion of "what depth is my recursive code generator actually operating at", and "woe to you if you forget a linefeed".

    Next thing you know, slashdot will be full of defenders who insist that Make's treatment of tab and space is a good thing.

    Like so much of Windows, whitespace-as-block-structure is a bug, not a feature.

    --
    Test your net with Netalyzr
  60. Re:White semantics make plenty of sense, young buc by Anonymous Coward · · Score: 0

    Really? I can write python without thinking about indentation and whitespace, run it through an auto-indenter when I'm done and have it work correctly? How?

    I dunno, ask the vim people, their autoindent works for me.

    Or better yet, just write in a programming language that doesn't expect you to write pretty code. The only people out there yelling at you to use python are the voices in your head.

  61. Re:So, will it FINALLY have block structures? by Hatta · · Score: 1

    Because the auto-indenter can't read your mind. It doesn't know where you want your blocks to begin and end. Whitespace in python is like brackets in perl. If you missed a bracket in perl, how would an autoindenter know where you intended to put that bracket? Same issue with python and whitespace.

    --
    Give me Classic Slashdot or give me death!
  62. Smartass C programmer says... by Comboman · · Score: 1

    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")

    If you're going to call print as a function maybe you should rename it printf. Or better yet, switch to a real programming language that already has printf.

    --
    Support Right To Repair Legislation.
    1. 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").
    2. Re:Smartass C programmer says... by Comboman · · Score: 1

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

      C syntax, but don't worry, you're slowly getting there. With the shift from print "Hello world" to print("Hello world") and then finally to printf("Hello world") you'll have reinvented what Bell labs created in the 60's. By the way, it's a joke (thus the "smartass" qualifier), don't take it personally.

      --
      Support Right To Repair Legislation.
    3. Re:Smartass C programmer says... by Anonymous Coward · · Score: 0

      Consistency.

    4. Re:Smartass C programmer says... by rbanffy · · Score: 1

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

      You know... Bragging about knowing C is the telltale sign of a very limited programmer. People brag about Lisp or Smalltalk or even Objective-C. Knowing C is not a reason to brag - it's the bare minimum one should know to be called a programmer.

      Far too many people regard C as the end of the path. It's only when you have passed it that you realize it lays pretty much in the beginning.

    5. Re:Smartass C programmer says... by rk · · Score: 1

      I know you're just being funny, but I hope that any truly smartass C programmer also knows that the printf family of functions that trailing f stands for "format" and not "function". python already provides the format stuff using the modulus ('%') on strings, which is sort of weird if you think of it a modulo instead of thinking of it as a simple mnemonic that the modulo operator is the same character as the format escape character. So calling the print function "printf" would actually be misleading as it does not take a format argument.

      Example:

      >>> from math import pi
      >>> print "The value of %s is %.2f." % ("pi", pi) # printf, python pre3 style
      The value of pi is 3.14.
      >>> a = "The value of %s is %.4f." % ("pi", pi) # sprintf
      >>> a
      'The value of pi is 3.1416.'
    6. Re:Smartass C programmer says... by Anonymous Coward · · Score: 0
      Far too many people regard C as the end of the path. It's only when you have passed it that you realize it lays pretty much in the beginning.


      And far more often do people overlook C and C++ as being too "old", so they re-invent the wheel over and over again, each time making things more complex and more bloated. It is a poor programmer who blames his tools, and I think "language of the month" types who disclaim the effectiveness of C and C++ need to stop trying to hide their limited knowledge of real world programming by inventing new languages that uniformly reinvent the wheel, and do it badly.

    7. Re:Smartass C programmer says... by Anonymous Coward · · Score: 0
      Or better yet, switch to a real programming language that already has printf.

      Whoa, that was implying that Python isn't a real programming language wasn't it? OH SNAP! That was a subtle burn man. Props to you. No recovering from that one.

    8. Re:Smartass C programmer says... by rbanffy · · Score: 1

      When the only tool you have is a hammer, everything looks like a nail.

      Both C and C++ are useful for what they were designed. But that's it. If you find yourself using them for problems they were not designed to handle, I strongly suggest trying other tools.

      And, BTW, C++ is plain ugly. Objective-C got it right.

  63. Re:White semantics make plenty of sense, young buc by Hatta · · Score: 1

    Since the two use BNF form, just write your code with curly braces then write a script to indent on a { and de-indent on a } and strip those characters. Pretty trivial really.

    Oh I see how that would work. You'd have to strip the non-semantic whitespace from the curly source before preprocessing too though.

    --
    Give me Classic Slashdot or give me death!
  64. And conversely.... by DrYak · · Score: 1

    Perl6 is backwards compatible with Perl5 even though it has many new features


    And conversely there are Perl5 modules that try to bring forward compatibility by enabling Perl6-like improvement in Perl5-code.

    Also, don't forget that one of the major new steps in Perl6 is the Parrot virtual machine which help interoperation between whatever code was compiled to run on it, including Perl6 (compiled with PUGS, for example), Perl5 (once the compiler is stable), C libraries (single binding for any language running on Parrot), or even Python (don't know which version will compile to Parrot).

    So you could slowly migrate perl5 to 6 even if they aren't compatible by :
    - keeping your perl5 code in backward compatibility mode of Perl6 and only adding the new code as Perl6-native.
    - slowly introducing perl6 features with modules in your current perl5 infrastructure so, shall you decide one day to migrate the code, the work would be half-way done
    - keep perl5 code running as is on parrot, and only write Perl6 in newer modules and have everything run next to each other thanks to the "one VM to rule them all" approach of Parrot.
    TMTOWTDI, you know the drill.

    Whereas, according to TFA, the older python 2.x branch will only run Old Python dialect (but will continue to be maintained for some time), and python 3.x branch will only run New Python dialect.
    Users either keep using old branch for old code, or rewrite their app before using new branch.
    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  65. Re:White semantics make plenty of sense, young buc by TheCouchPotatoFamine · · Score: 1

    yay for the grasp (you'd have to lstrip it, to be precise) pass it on! /cool

    --
    CS majors know the time/space tradeoff, but they never get taught the 3rd, crucial, tradeoff of the set: comprehension!
  66. Write-up is pure FUD by CarpetShark · · Score: 1

    There IS no problem. Python 3 will be incompatible with 2.5, yes. That's why there'll be a python 2.6. Duh. It'll be compatible with 2.5 and will provide some 3.0 features when specially asked for (from future import ..), but also warn of deprecations, incompatibilities, etc.

    1. Re:Write-up is pure FUD by Incongruity · · Score: 1

      AND 2.6 code will more or less be completely translatable by the 2to3 translators that are already in existence... this is a non-issue.

  67. Re:So, will it FINALLY have block structures? by Surt · · Score: 1

    Thank you for posting this. I always find myself going crazy trying to explain the problems to pythoners, but I think you really put it together succinctly in this post.

    --
    "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  68. 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.

  69. Suggestions for noobs by joeslugg · · Score: 1

    "Learn Python" has been a standing entry on my to-do list for quite some time.
    What would people suggest -- should I bother learning 2.x or just wait for the shiny
    new 3.0?

    Granted, by the time I get that far on my to-do list they'll probably be on version 9...

    1. Re:Suggestions for noobs by vrmlguy · · Score: 1

      Go ahead and learn the 2.x version. The 3.0 version isn't much different, and the differences are usually trivial. For example, any time there are two version of a function in 2.x, one of which starts with an 'x', it's almost always the 'x' version that you want to use. So go ahead and do so; all that happens in 3.0 is that the 'x' will go away. The only other major change is that the print statement becomes a function, and the 2to3.py converter will handle that conversion just fine.

      --
      Nothing for 6-digit uids?
  70. Duh by OrangeTide · · Score: 0, Troll

    This is why I don't use languages that have a single vendor controlling the standard and tools. At least with C and C++ there are many many vendors and the standards are backwardly compatible (not counting the first C++ standard breaking all the de facto standard C++ source)

    Languages like D, Haskell, Python, Perl, Lua, etc are all pretty interesting. but making them a core component of your business seems like a bad idea. The people who put them together are not getting paid by you and don't really care about your company's schedules. Generally you just have to force users of your scripts to install the right version of python/whatever until you can move all your software forward.

    Hopefully you can move your source forward before RHEL and Ubuntu switch to the new tools exclusively (there will be a transition period, thankfully). But then you're still stuck having to support customers who run an older RHEL and won't upgrade.

    With C I don't have to do any of this. I have other problems to worry about, but they are at least in my control.

    --
    “Common sense is not so common.” — Voltaire
    1. 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.

    2. Re:Duh by DragonWriter · · Score: 1

      Languages like D,


      Er, which D language? There appear to be at least six.

      Languages like D, Haskell, Python, Perl, Lua, etc are all pretty interesting. but making them a core component of your business seems like a bad idea. The people who put them together are not getting paid by you and don't really care about your company's schedules. Generally you just have to force users of your scripts to install the right version of python/whatever until you can move all your software forward.


      Since they are OSS, (except, maybe, D, depending on which "D" you are referring to) you don't have to "force" them to do much but install your software, which is free to include the language implementation it needs. And you can continue to do so, freely (including paying someone for maintenance of the language, its bundled libraries, etc., if you wish) even after whoever originally made the language has discontinued making or supporting the version you want to use, the platform it runs on, or the language entirely. Something you can't do with your average commercial language product.

    3. Re:Duh by OrangeTide · · Score: 1

      I realize they are OSS. But I don't agree with your evaluation of how that plays out in the real world.

      I would prefer something like C where we have plenty of open source compilers of excellent quality. But customers are not required to use a particular implementations of the compiler in their environment to use our stuff.

      As for 'D' I am referring to the most popular one. Which does appear to have other implementations (forks really).

      When important languages like Python or Perl announce they are going to improve the language such that it breaks older scripts, it just shows that the language was never that mature to begin with. Or that it's more fun for the (unpaid) authors to design and innovate than to be maintenance engineers.

      --
      “Common sense is not so common.” — Voltaire
    4. Re:Duh by DragonWriter · · Score: 1

      When important languages like Python or Perl announce they are going to improve the language such that it breaks older scripts, it just shows that the language was never that mature to begin with.


      So, C90 -> C99 provided that C was never that mature to begin with? Sure, most implementations probably work around the compatibility issues in most cases, with appropriate options; then again, Perl and Python both have automatic conversion tools, and the former at least as a compatibility mode. So whether you focus on languages changes or how those language changes are implemented, I don't see an enormous difference in kind here. There is something of a difference in degree, but then again, I don't see anyone, especially not GvR, Perl, or Matz, claiming that Python, Perl, or Ruby are as "mature" as C.

      Or that it's more fun for the (unpaid) authors to design and innovate than to be maintenance engineers.


      I don't know off the head about Wall (or Matz), but last I checked Guido van Rossum was paid by Google, and half of that (by time) is to develop Python. I believe that it was something for which he was paid when he first developed Python, as well.

      Then again, whether or not they sell licenses or get a regular paycheck from an employer for work on the language, its certainly not at all the case that the developers of popular OSS languages lack a financial stake in the industrial success of their language. Not only does it have some effect on their own employability in traditional jobs, it is also a source of income for them in consulting, publishing books, etc.
    5. Re:Duh by OrangeTide · · Score: 1

      So, C90 -> C99 provided that C was never that mature to begin with? strawman. you ignored that such an update didn't break existing code.
      --
      “Common sense is not so common.” — Voltaire
    6. Re:Duh by maxume · · Score: 1

      If you are running a software business that needs to be more conservative than the python release schedule, you aren't running it correctly.

      Tools like py2exe and py2app at least make it straightforward to force your users to install the right version of python.

      --
      Nerd rage is the funniest rage.
    7. Re:Duh by DragonWriter · · Score: 1

      strawman. you ignored that such an update didn't break existing code.


      If I did, that wouldn't be a strawman, it would be a bad analogy. I wasn't saying you argued that C90 -> C99 said something about C, I was saying your argument suggested that by analogy.

      OTOH, I didn't "ignore" that since it is not true. C99 makes illegal constructs that were legal in C90. Since the Perl6 primary implementation can also run Perl5 code even though Perl5 code is not valid Perl6, I don't see how that is substantially different from the fact that most practical C99 implementations are likely to have options to allow the illegal C90 constructs (and, conversely, most C90 implementations probably warned on them in the first place), though they are strictly-speaking not valid C99. Both language updates break existing code. Both have workarounds in the implementations people are likely to use which make the fact that the language update breaks existing code almost completely irrelevant.
    8. Re:Duh by Anonymous Coward · · Score: 0

      nice generalization there. What's your next trick?

  71. Re:Python to not be backwards compatible by fyngyrz · · Score: 0

    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've fallen off your lawn, and I can't get up.
  72. If you develop in python by Anonymous Coward · · Score: 2, Funny

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

    1. Re:If you develop in python by Anonymous Coward · · Score: 0

      Actually that's the new feature in python 3.

  73. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 1

    Well, I write python using vim's quite simplistic autoindenter, and to tell you the truth, this does not happen.

  74. You must be joking!!! by zukinux · · Score: 0

    Python 2.5 isn't backward compatible to python 2.4 (!). In-fact, I'm still using python 2.4 only because I cannot upgrade since 50% of my python scripts will not work!
    So, that fact that change in major version from 2 to 3, would be backwards incompatible, shouldn't surprise anyone who used same python scripts between 2 different minor versions.

  75. Re:So, will it FINALLY have block structures? by pthisis · · Score: 1

    Guys, block structured languages you can trivially derive pretty-printing formatting. Which means you get the "easy to read" ability trivially.

    You don't get it trivially, you get it in exchange for having block delimiters. Python avoids having redundant delimiters + indentation (the latter you _need_ for readability, hence the reason _why_ all those pretty-print programs exists).

    You should NEVER read the Silly Parenthesis in LISP, that gets taken care of for you by any one of a gazillion tools...
    EG, on C, you can cut and paste trivially. You can't on python, you need an editor which parses the language sufficiently to understand that "This is a code block going into a different code block".


    "You use a smart editor that understands parens in LISP. In Python you need a smart editor that understands whitespace."

    --
    rage, rage against the dying of the light
  76. Re:so who's going to write the conversion tool $$$ by Anonymous Coward · · Score: 0
  77. Cython by Garridan · · Score: 1

    One such project is Cython. It enables you to write in Python which gets compiled to C; trivializes using Python objects in C and vise verse.

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

    1. Re:Much like python's approach by Tacvek · · Score: 1

      Not to mention the automatic code translator that they intend to release with 2.0 which should be able to convert most code with little manual intervention (that is the goal anyway).

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
  79. Re:#1 way to prevent adoption of new language vers by jetpack · · Score: 1

    This is far superior to Java's "always backwards compatible" approach which has lead to a lot of cruft building up over the years.

    This is exactly what I first thought about when I read the complaints regarding Python 3. There is a lot of crud that Java still carries around with it that dates back from it's earliest incarnations. There is talk that Java 7 will ditch much of the cruft and therefore (finally) be backwards-incompatible with previous versions. There are warts that Java currently supports that are making new additions to the language difficult and the solutions to those problems can be ugly, at best. I recall that fixing generics and adding closures are considered two of the big issues.

    However, The current track of Java won't just disapear. Java 6 will continue to be supported while Java 7 will become the new-and-improved Java. Whether this actually comes to pass is anyones guess. I heard about it first on The Java Posse and it sounded a bit more like conjecture than fact.

    At any rate, I think that with any rapidly evolving language enough junk will build up that eventually you just need to bite the bullet and cut that shit loose. Personally, I think this method of splitting the language into two tracks is best for both languages. Can't wait for the incompatible goodness :)

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

  81. How Is This News? by rebelcan · · Score: 1

    Hasn't that been on the Python website for a year or two now? I'm fairly sure it has been, something about how they're re-writing the core stuff, and this re-write would break backwards compatibility. From what I remember, the rewrite has to do with speed and such, which sounds like a good plan to me.

    I don't really see this as much of a problem, really. Don't want to re-write your application? Don't move to Python 3000. I have several versions of python installed on my Linux machine at home, simply because there are modules that don't work with version 2.x or version 2.y or what-have-you.

    --
    God is dead -- Nietzsche
    Nietzsche is dead -- God
    Zombie Nietzsche lives! -- Zombie Nietzsche
  82. Re:So, will it FINALLY have block structures? by Haeleth · · Score: 1
    That's when you're WRITING code. You are interacting with vim on a line-by-line basis. Each time it fails to guess what you intended, you immediately (and probably subliminally) correct it.

    The point remains that Python cannot be indented automatically. For example, consider the trivial example of

    def f(i):
    if i > 2:
    i = 10
    i = i + 1
    return i
    There are three valid ways this could be indented, with the possible values of f(1) being None, 1, and 2. It is impossible for a computer to guess which is intended. Therefore, it is impossible in general to auto-indent Python code, QED.

    "It's not a problem for me" is not a viable answer to "this is a problem for many people". Some people don't find Perl too hard to read, but that doesn't mean Perl isn't often hard to read. Some people don't find Ruby too slow, but that doesn't mean Ruby isn't often slow. And you don't find Python's significant whitespace a problem, but that doesn't mean it doesn't make life more difficult for the writers of IDEs and automatic code transformation tools.

    Observe that the best-known other programming language with significant whitespace, Haskell, provides an alternative brace-and-semicolons syntax as an option for cases where whitespace is not the most readable choice. Python has already been heavily influenced by Haskell (that's where the idea for list comprehensions came from, for example); it's a shame that political and religious issues mean it's unlikely ever to copy this other very practical idea.
  83. 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.

    1. Re:A cunning plan by QuestorTapes · · Score: 1

      Baldrick, you wouldn't know a cunning plan if it painted itself
      purple and danced naked on top of a harpsichord singing
      "Cunning plans are here again".

  84. Re:So, will it FINALLY have block structures? by zippthorne · · Score: 1

    The reason is obvious.  Just ask the Fortran guys why they dropped semantic whitespace in the switch from fortran-77 to fortran-90.

    Whitespace shouldn't have semantic meaning because then you're stuck with semantic whitespace that might not be the easiest to read.  For example, The following is MATLAB code specifying a 10x10 matrix that could be used for future calculations.

    A=[[ 77 210 214 133 228 131 200 223 81 214]; [ 138 165 145 225 50 85 174 3 245 160];[ 38 209 94 44 76 110 118 196 186 34];[ 178   169 179 250 169 57 145 248 105 53];[ 96 87 139 69 72 148 203 253 190 155];[ 220 74 113 64 120 194 15 201 68 161];[ 218 87 177   224 16 135 154 112 112 94];[ 151 136 159 188 253 163 12 127 238 147];[ 127 186 203 34 149 53 106 54 174 115];[ 230 79 244 3 108 97 78 164 54 11]]

    or

    A=[[ 77   210   214   133   228   131   200   223    81   214];
    [   138   165   145   225    50    85   174     3   245   160];
    [    38   209    94    44    76   110   118   196   186    34];
    [   178   169   179   250   169    57   145   248   105    53];
    [    96    87   139    69    72   148   203   253   190   155];
    [   220    74   113    64   120   194    15   201    68   161];
    [   218    87   177   224    16   135   154   112   112    94];
    [   151   136   159   188   253   163    12   127   238   147];
    [   127   186   203    34   149    53   106    54   174   115];
    [   230    79   244     3   108    97    78   164    54    11]]

    Which one would you prefer to maintain?  Suppose you have to occasionally tweak coefficients stored in the A matrix?

    Whitespace is just one tool in many to make your code readable by humans, a necessary condition for ease of maintenance.  Horrible formatting can make even good code difficult to comprehend, so why would you want a language to restrict you to one way of doing things?  Sure, it lets you write truly atrocious code, if you're an asshole, just like perl.  But it also gives you the ability to write extremely legibly.

    --
    Can you be Even More Awesome?!
  85. Blessing and a curse. by serviscope_minor · · Score: 1

    Backwards compatibility is both a blessing and a curse. Python is taking the other approach to C++ where backwards compatibility ismaintained almost regardless of the cost.

    I like C++ and I like Python. I'm not interested in an X sucks debate. C++ definitely has warts which will never go away, because the committee will always maintain backwards compatibility. For instance the rather ephemeral nature of arrays makes it hard to use builtin arrays as a type, without causing all sorts of pain and suffering. New syntax can be ugly because introducing new keywords can break existing code. And finally, it looks like the rather abortive "export" is here to stay.

    On the other hand, though, I have some quite large C++ libraries with code dating back years. Since it was written in standards compliant C++, it remains in good working order. And furthermore, it will remain in good working order when C++0x rolls out. As a result, I will be able to write new code using the new features of C++ without having to worry about fixing my entire set of libraries in one go.
    I'll also be able to resurrect ancient code which I haven't run for years and it will "just work".

    These are very valuable, but on the other hand some things in the language will never be fixed. Python, on the other hand will become less warty as time goes on. That's good, and the language will be better as a result. The penalty is that old code will not work quite so easily.

    Both are good, and both are bad. My personal preference leans towards compatibility, but not quite as strongly as the C++ committee.

    --
    SJW n. One who posts facts.
  86. Not 100% by agbinfo · · Score: 2, Informative

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

    1. Re:Not 100% by hostyle · · Score: 1

      I ported myself from girlfriend 0.5 to fiance 0.9. I experienced some unexpected issues too. Good luck mate. Its a hard fight!

      --
      Caesar si viveret, ad remum dareris.
    2. Re:Not 100% by Anonymous Coward · · Score: 0

      Your lifestyle, if and when you decide to upgrade to Wife 1.0, can be functionally indistinguishable from Monk 1.0, for a significant amount of hardware out there.
      Be very careful with that one, he said, ruefully.

    3. Re:Not 100% by drolli · · Score: 1

      You are right, as far as i remember these where really really minor ones, but i cant remember exactly. But since perl is an easy to debug language and for sure all perl scripts exhibit perfect orthogonality in the use of language construct and an perfect documentation i am sure these where easy to locate and fix.

  87. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 1

    If that code was originally input in that state, then it never had a meaning, since it is not parseable by a python parser. If it was ever indented both in a way it had a meaning and in a way it had the intended meaning, then of course it is possible for an editor to change the indentation in semantically preserving ways---and this does not even require an editor which actually parses the code. So your problem is: "if you have code for which even not the python parser can attach meaning, then an editor cannot attach meaning to it and manipulate it meaningfully". That problem exists for... well... every language.

    I fail to see "political and religious" issues in this issue. It is simply a design choice.

  88. Re:#1 way to prevent adoption of new language vers by bconway · · Score: 0

    Real threading.

    --
    Interested in open source engine management for your Subaru?
  89. Re:So, will it FINALLY have block structures? by ravenwing_np · · Score: 1

    I'm glad that you brought up the "Cut and Paste" idea. If you are duplicating code, you should be refactoring it out into a function, not creating more lines to maintain. The code will become cleaner and more readable, no matter what the language. You shouldn't have to depend on clever IDE features to defend bad practice.

    Python might have problems, but intentional whitespace isn't the biggest.

  90. Why switch? by Vellmont · · Score: 1


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

    Unlike closed source languages, Python and Perl are both totally open. If you don't want to switch to the new 3.0 language, don't. If enough people don't want to switch to 3.0, 2.x will live on forever. If everyone leaves 2.x and you're the only one on it.. you can continue to support it yourself for however long you wish.

    If porting your code to 3.0 is advantageous, do it. But no one is forcing you either way. There's no foot shooting going on, it's offering an alternative.

    --
    AccountKiller
  91. Java's Mistakes by SoopahMan · · Score: 1

    It's been said several times here that Java keeps making pointless sacrifices for backwards compatibility. Some progress requires a breaking change, and a major point release is a perfect place to make that kind of change. Java introduced Generics, but still returns Object from Generic Collections for backwards compatibility. Is anyone actually benefitting? No. Java authors worried about compatibility are still using Java 1.3, while those working with the newer JVM never fully gain the benefits of Generics.

    Issues like the non-unified string implementation in Python are perfect for moving forward. Bravo Python.

    So the answer to your question is, neither. The question is, how long before somebody gets Java out of its pointless rut?

    1. Re:Java's Mistakes by julesh · · Score: 1

      Java introduced Generics, but still returns Object from Generic Collections for backwards compatibility.

      Huh? As far as I can see, List.get() (for example) returns E.

  92. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 0

    I guess Smalltalk needs a spell checker.

    thanks,
    python

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

  94. Re:So, will it FINALLY have block structures? by harry666t · · Score: 1

    What's the problem with internally changing the indentation-based blocks to some other format, just for some manipulation, and then converting it back? for example:

    if foo:
      if bar:
        doSomething()

    for item in collection:
      pass

    One would like to cut-and-paste first block into the second, replacing the "pass" thing. Internally, the IDE could replace the above code with:

    if foo:
      if bar:
        doSomething()
      endif
    endif

    for item in collection:
      pass
    endfor

    Then simply:

    for item in collection:
    if foo:
      if bar:
        doSomething()
      endif
    endif
    endfor

    And back to Python:

    for item in collection:
      if foo:
        if bar:
          doSomething()

    Same for code generators and other magical stuff that "just works" with other languages. Of course use some magic escape sequences to avoid name conflict with symbols that are alrady sitting in the code.

  95. 2.x will still be around by Anonymous Coward · · Score: 0

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


    What's the big deal? It's not like Python 2.x is going to go away or suddently stop working.

    Old program will continue to use the old version, and new projects will start using the new version.
  96. 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."
  97. Re:#1 way to prevent adoption of new language vers by Anonymous Coward · · Score: 0

    Gaah! Iterators. I was all enthused about them once until two
    things happened: (1) Someone asked me what they were good for,
    and (2) I got burned by trying to use an iterator twice.

    My answer to (1) was pretty lame -- and it still would be, The number of
    cases where they give you are real advantage are few and far between.
    (2) is a real usability problem: if you try to re-use an iterator,
    it simply produces nothing. This will catch many people many times,
    as follows:

    def foo():
            x = make_some_iterator()
            bar(x)

    def bar(x):
              for i in x:
                        something
              for j in x:
                        something

    The second for loop will do nothing, unexpectedly and silently.

    Iterators bad! Bad! BAD! (Unless you only use iterators, of course,
    in which case people would expect them. So, it's really this:
    Mixing iterators with lists: BAD! BAD!)

  98. Google is 15% Python... and 85% what!? by alanturinglives · · Score: 1

    Google is 15% Python... and 85% what!? Anybody knows with any degree of accuracy? Which % of Java for instance? And what will be of Yahoo! if Microsoft takes it over? www.yahoo.com/default.aspx making ASP.NET calls to SQL Server? Just thinking about it gives me the shivers!

    1. Re:Google is 15% Python... and 85% what!? by peektwice · · Score: 1

      Oh god...I'm going to say it...please make me stop....
      Silverlight
      Damn it! I said it!

      --
      Other than this text, there is no discernible information contained in this sig.
  99. Google is 15% Python... and 85% what!? by alanturinglives · · Score: 1

    Google is 15% Python... and 85% what!? Anybody knows with any degree of accuracy? Which % of Java for instance? And what will be of Yahoo! if Microsoft takes it over? www.yahoo.com/default.aspx making ASP.NET calls to SQL Server? Just thinking about it gives me the shivers! What do you think yahoo.com would look like in 5 years if it all goes through? Which technologies would it be using?

  100. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 0

    Indentation in Python has syntactic meaning, not semantic meaning.

  101. I can see my resume now... by Mr.+Underbridge · · Score: 1

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

    I'm totally going to invent some certification and call myself a "Cobra Commander" on my resume.

  102. 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 Verte · · Score: 1

      1 & 3 are horrible. 1 makes the code more difficult to read, 3 gives developers options for formatting, which is a bad idea- have you seen the way some people format?! What you do with code that doesn't leave your bedroom is up to you, you can write your own the-matt-mobile-syntax -> 4-sp-indents converter so you can format however you like, but if I ever have to maintain your code, I will not be happy. Uniformity is a good thing in this respect.

      Oh, and as for self, type "import this" and note the second line.

      --
      We at slashdot are scientists, specialists and kernel hackers. Your FUD will be found out.
    2. 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.

    3. Re:Can we put in requests? by the-matt-mobile · · Score: 1

      Ah - a true Python believer, huh? So, you'd rather believe that someone who wants to have the freedom to format their own code is a horrendous coder rather than accept that maybe - just maybe - there are real occasion when deviating from the rigid Python rules might actually ADD to the readability of certain kinds of code. I guess we should never split a string across multiple lines or a function either. I guess copying and pasting code from a source that doesn't preserve formatting (like, oh say, a web page or e-mail) has never bitten you because indenting wasn't preserved correctly. But, feel free to bury your head in the sand about indentation. The rest of us will go on indenting our Perl/C#/Java/Ruby/C++/whaterver code for readability and practicality and leave the the true belivers in the One-Python-Way to their religion.

    4. Re:Can we put in requests? by stuntpope · · Score: 1
      So your arguments really all boil down to indentation, which is the typical complaint against Python made by non "true Python believers" (oh those nasty true believers!)

      I guess copying and pasting code from a source that doesn't preserve formatting (like, oh say, a web page or e-mail) has never bitten you because indenting wasn't preserved correctly. And you'd want to keep it in this misaligned form after knowing about it, just because that's the way it got pasted into your code? How's that for readability?

      I, for one, thank Python for its indentation requirements each time I have to open a previous co-worker's Perl code he wrote with a messed up Emacs mode that produced tabs for indentation, and spaces for alignment, and nothing looking right.

      But, feel free to bury your head in the sand about indentation. The rest of us will go on indenting our Perl/C#/Java/Ruby/C++/whaterver code for readability and practicality and leave the the true belivers in the One-Python-Way to their religion. And the rest of us Python developers, heads firmly in sand, will continue to program in Python without complaining about indentation, and Python code and applications will continue to flourish and be adopted. Your argument has been around since at least 1.5, when I learned Python. I suppose the argument will continue to be made. As will Python software, naysayers aside.

      I'll leave it at that, lest you taunt us a second time-uh.

    5. Re:Can we put in requests? by Anonymous Coward · · Score: 0

      And you'd want to keep it in this misaligned form after knowing about it, just because that's the way it got pasted into your code?

      I'd fix it except that I can't. In other languages we can mechanically distinguish between

      while (a) { b; } c;
      and

      while (a) { b; c; }
      and reformat appropriately, but Python cluelessly relies upon three of the minority of US-ASCII characters knows to be delivered unreliably, leaving the recipient to guess what was originally written. Python desperately needs a convention to encode INDENT and DEDENT tokens using printable characters, so discussing code online is actually feasible.
    6. Re:Can we put in requests? by Verte · · Score: 1

      Ah - a true Python believer, huh? So, you'd rather believe that someone who wants to have the freedom to format their own code is a horrendous coder rather than accept that maybe - just maybe - there are real occasion when deviating from the rigid Python rules might actually ADD to the readability of certain kinds of code. I don't doubt that there will be occasions when breaking the rules is ok. But there are very few cases. I have not come across such a case. If you do need to break the rules, you're more likely to be doing something silly and need to rethink your design.

      If you were writing code for the Linux kernel, say, you'd follow Linus' style guide, which mandates 8-space indents. Now, if your code had more than five levels of indent such as to become unreadable, would you jump up and down about how the style is no good? Not if you actually want to get your code included. You'd recast some of the inner levels into their own functions, and inline them if you like. This makes the code much more readable. If this is ever a bad idea, it will be clear to the reader why you're breaking the rules. But in general, breaking the rules means you need to rethink your design for readability.

      I guess we should never split a string across multiple lines or a function either. What makes you say that? The following ways work great, and are easy enough to follow:
      foo(bar,
            baz)
      blee = "bl" +\
                  "uu"

      I guess copying and pasting code from a source that doesn't preserve formatting (like, oh say, a web page or e-mail) has never bitten you because indenting wasn't preserved correctly. Sure, but you learn quickly :) some forums don't support pre tags, and some (though few) people use horrible email readers that don't preserve the format of text emails, and you learn quickly when that is the case. For email, most code is sent in a .py/.diff/.tar attachment. If you want to mix comments and code in a forum that doesn't support pre-tags, you can write a 3-liner to convert indents to non-breaking spaces, or whatever format system the forum uses.

      The rest of us will go on indenting our Perl/C#/Java/Ruby/C++/whaterver code for readability and practicality and leave the the true belivers in the One-Python-Way to their religion. I've never EVER had someone point me out to anything in PEP-8 that would be better done some other way. If code formatted to PEP-8 is ever unreadable, can you point out what you'd change?

      Most people who use Python do use other languages regularly. Many of us write extensions in C/Java/whatever.Net, and many of us enjoy other languages too- I myself use C, Scheme and D daily; but I don't think any of us (who use Python daily, at least) would ever argue that another language would be as easy to read as Python.
      --
      We at slashdot are scientists, specialists and kernel hackers. Your FUD will be found out.
  103. Re:So, will it FINALLY have block structures? by Alpha830RulZ · · Score: 1

    And the difference between a tab and a curly brace semantically is exactly what? Except that with curly braces, you need to have two of them for the language to work, and tabs, so that your brain can make sense of it, and in your case, an editor to keep track of it so you don't biff it up. :-)

    I suggest that this is fairly obviously a matter of preference, rather than something that has an actual functional issue nearby. Indentation works fine as a block mechanism, and you avoid a whole class of code entry errors. I say that as a long time C, Java, and Perl programmer, who has found my new love, Python. If it's good enough for the geeks at Google, I suspect it's good enough for me.

    Common, religion is bad enough in politics.

    --
    I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
  104. Re:So, will it FINALLY have block structures? by ceoyoyo · · Score: 1

    Nonsense. There is NO difference between a tab character and those stupid curly braces C uses, or any other block indicator character. If it really bothers you, get yourself an editor that draws out tab characters for you.

    Now, I dislike using spaces to indicate blocks. But tabs are great. Naturally there are Pythoners who think the opposite.

  105. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 1, Insightful

    I'm glad that you brought up the "Cut and Paste" idea. If you are duplicating code, you should be refactoring it out into a function

    And just what do you suppose is the quickest way to move a block of code out from its current location, possibly nested inside various conditionals, loops, etc, to a (presumably top-level) function?
  106. Kiss My Ass! by Anonymous Coward · · Score: 0

    the migration tool 2to3 performs this change automatically... so the incompatibility is greatly exaggerated.


    Kiss my ass! It is incompatible! The new version requires that old code be rewritten in order to function. Whether that code is rewritten manually or by a tool makes no difference, the fact remains that the code must be rewritten. That is no exaggeration.
  107. Re:So, will it FINALLY have block structures? by ceoyoyo · · Score: 1

    Try this thought experiment, will you?

    Suppose I have some Python code, with my blocks indicated by tab characters. I now do a search and replace, replacing every tab with a {. Then I write some trivial code that searches through and sticks in a } wherever there is one less tab beginning a line than the line above.

    Now I have C style blocks. The difference between a { character and a ^t character is... well, there is no difference except their ASCII code. There's a trivial difference between the } character and the lack of a ^t character. If you encode the Python equivalent of the } as a ^t^h then even that goes away.

    I WOULD be in favour of eliminating the option to denote Python blocks with a space though. I definitely would NOT be in favour of using some stupid visible character PLUS whitespace (if you want your code to be readable) to do the job that ^t does very nicely right now.

  108. Re:So, will it FINALLY have block structures? by ceoyoyo · · Score: 1

    Perhaps that's because neither you nor the post you replied to understand what's going on? Python has block delimiters just like any other language. It's a tab character. The only difference is that most editors make it an option to display it.

    Yes, you can also use spaces, which I find sloppy. But real Python programers use tabs. :P

  109. 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.
  110. Re:#1 way to prevent adoption of new language vers by Peaker · · Score: 1

    I agree there's a problem. I think the problem is that __iter__ on iterators returns self.

    I think that you don't want a "for" loop or general iteration to just take an iterator and continue where it left off by default.

    If it used an explicit syntax, such as:

    for item in tillend(iter): # where tillend takes an iterator, and has an __iter__ that returns that iterator.

    Is less error-prone than:

    for item in iter:

    Exactly because of the reason you mention.

    It will be clear that:

    for item in tillend(iter): ...
    for item in tillend(iter): ...

    is problematic, because tillend makes clear that its a stateful iterator being consumed.

    As for a workaround for now, just be careful to always assume you're being given an iterator, and list'ify it when you want to iterate it more than once. Also make sure you name iterators "iter" something so you don't forget that they are stateful.

  111. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 0

    A few points...

    1. How often do block structured language bugs boil down to an extra, missing or misplaced } (or language equivalent), I very strongly suspect that is one of the top 10 most common causes of compile time errors. A smart compiler will give you the line number so it's usually easy to fix but what a waste of time.

    2. Being able to 'easily' cut and paste blocks of code without any reformatting is not a serious problem. Most important; cut-n-paste programming is a terrible habit that results in unmaintainable code. Secondarily, even in a fairly stupid editor this is trivial.

    3. Recursive code generation?!? You've got to be joking. First; domain specific problems will always be best resolved with domain specific languages. So yes, for all those tasks where you MUST generate code suitable for direct injection into an existing python program you have to do a one-liner to determine the current depth at your injection point. You'll also need to parse through the entire file to see if you are inside a """ or ''' and see if the previous line is a continuation \. Similar ugly and perverse hacks are needed for every block language that supports any multi-line constructs (ie: nearly all of them).

    That's what happens when you use brain damaged techniques instead of putting your generated code in its own module with its own whitespace and importing it.

    As for suggest LISP-ers should never read parentheses... you're smoking the good stuff.

  112. Python has been doing this for years. by cduffy · · Score: 1

    #!/usr/bin/env python2.2 is the preferred way to call a script which depends on Python 2.2, just as #!/usr/bin/env python2.4 does the same thing but specifying a 2.4 interpreter. If you call "#!/usr/bin/env python", then you get whatever the system default is, and that's your own fault... but point is, having multiple names for the interpreter so you can specify an individual version if you want to is already SOP.

    Also, this isn't news. It isn't even sorta-news. This has been planned and publicly announced for years.

  113. functionally by nguy · · Score: 1

    Baxter also added another tidbit for attendees, saying that Python accounts for around 15 percent of Google's code base."

    Given how much more compact Python programs are than equivalent C++ or Java programs, that must mean that a big part of Google's functionality is written in Python.

  114. So are they fixing the indentation? by Anonymous Coward · · Score: 0

    Is the indentation thing among the changes? Seriously, that's the number one thing that keeps me from using Python.

  115. Re:Use by Intron · · Score: 1

    Sorry, you lose. Parrot is the virtual machine on which perl 6 will run, not a language. python will also run on parrot.

    --
    Intron: the portion of DNA which expresses nothing useful.
  116. Re:Python to not be backwards compatible by VGPowerlord · · Score: 1

    If it isn't backwards compatible, it isn't Python, as far as I'm concerned.

    Just as importantly, if I have to relearn a language, it isn't the same language, as far as I'm concerned.

    That one refers to Perl 6, but I suppose it could be applied to Python 3.

    It also killed off any interest I had in learning Python 2.5 if I'm just going to have to relearn it next year anyway.
    --
    GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
  117. Re:Use by chromatic · · Score: 1

    The AC meant that there are Perl 6 implementations which run on Parrot, a Haskell backend, and a CL backend. (There's also a Perl 5 backend.)

  118. Re:White semantics make plenty of sense, young buc by debatem1 · · Score: 1

    If it helps, I can whip up a script that would do that and you could just add a make macro that would handle it. That way you'd be able to use the tools you're used to.

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

  120. Its another language similiar to Python .... by 3seas · · Score: 1

    There should be no problem so long as it is treated as a different language in regard to installations of the Python interpreter and code it recognizes.

    In other words the only change that needs to happen is the ability of the interpreter to recognize a header element that tells it whether or not in can run the program.

    # !Python

    or

    # !python3

    And I'm sure someoen can com up with a simple preprocessor to direct code execution to the right interpreter.

  121. 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.
  122. Re:#1 way to prevent adoption of new language vers by Anonymous Coward · · Score: 0

    ONOZ! Relax indeed. Just find a new job that uses Python 3.0 and leave your old cruft for some poor shmoe to maintain! :D

  123. Re:so who's going to write the conversion tool $$$ by Anonymous Coward · · Score: 0

    The CPython developers, actually, and it's free and already in progress.

  124. Incompatibility My Ass... by Secret+Rabbit · · Score: 1

    Speaking about the language, sure. But, actually causing problems, I highly doubted.

    It would be trivial to work around this. Change:

    #!/usr/local/bin/python

    To:

    #!/usr/local/bin/python2.4

    Then if you really really wanted to, start moving to 3.x at your leisure. There is exactly zero reason why this should cause serious problems if one doesn't have a need to "upgrade."

  125. Re:So, will it FINALLY have block structures? by prockcore · · Score: 1

    You sure use a lot of punctuation for someone who thinks whitespace is better indicative of structure.

  126. Re:So, will it FINALLY have block structures? by prockcore · · Score: 1

    And the difference between a tab and a curly brace semantically is exactly what?


    One is visible. One isn't. One is unmistakable, the other can be confused with spaces.

    My biggest problem with python is having a large group of nested "if" statements. It is extremely difficult to eyeball which "else" belong to which "if". At least with braces I can use "%" in vi to walk through the structure of my code, seeing exactly which else belongs to which if.
  127. Re:White semantics make plenty of sense, young buc by debatem1 · · Score: 1

    This script is currently available here. It's called curlyPy. Let me know how it works for you.

  128. Re:White semantics make plenty of sense, young buc by debatem1 · · Score: 1

    this script is available here. Sorry for the earlier busted link.

  129. Re:So, will it FINALLY have block structures? by prockcore · · Score: 1

    Python has block delimiters just like any other language. It's a tab character.


    Nonsense. The braces go at the beginning and end of a block. This is opposed to multiple tabs go at the beginning of every line.

    Besides, I thought Guido made it perfectly clear, spaces, not tabs.
  130. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 1, Informative

    The difference between a { character and a ^t character is... well, there is no difference except their ASCII code.

    Braces and brackets always work (except for a few long-obsolete systems confined to Scandinavia), but it's very common for whitespace characters to be munged by editors, mailers, and browsers. We see it all the time, even in this very forum. Why did you write "^T" in your comment? Because a real tab wouldn't have worked!

    (Its codepoint is actually U+0009 or ^I, by the way, though the C escape is \t.)

  131. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 0

    "Python has block delimiters just like any other language. It's a tab character."

    No, it doesn't have to be a tab for the white-space. The space-bar works too.

  132. 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....
  133. Re:So, will it FINALLY have block structures? by DragonWriter · · Score: 1

    No, sadly, they aren't fixing any of the key problems with the language, they're just not maintaining compatibility. Should be pretty much the death knell for python. I guess ruby wins.


    If not maintaining compatibility is the "death knell", then Ruby is eliminated (1.9 isn't backward compatible with 1.8.x), too.
  134. Re:So, will it FINALLY have block structures? by DragonWriter · · Score: 1

    I'm glad that you brought up the "Cut and Paste" idea. If you are duplicating code, you should be refactoring it out into a function, not creating more lines to maintain.


    Perhaps you should reconsider that criticism after thinking about the difference between "Cut" and "Copy", and thinking about what the most natural way is to move a large block of already-written code that would otherwise need to be repeated from the inside of one function out into into its own function without creating more lines to maintain.
  135. Re:So, will it FINALLY have block structures? by DragonWriter · · Score: 1

    Perhaps that's because neither you nor the post you replied to understand what's going on? Python has block delimiters just like any other language. It's a tab character. The only difference is that most editors make it an option to display it.



    The tab (or spaces) in Python are not block delimiters. They are per-line block-level markers, which are not, at all, the same thing, though of course there is a direct conversion between code in which blocks are indicated with block-level-markers and otherwise-syntactically-identical code in which blocks are indicated with delimiters (which is why languages with regular, unambiguous delimiters can be automatically indented by editors.)

  136. 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
  137. Re:Python to not be backwards compatible by Ambidisastrous · · Score: 1
    That points will be a few years away. Python 2.6 is going to be released in April, and there will also be a 2.7, 2.8 and probably 2.9.

    Here's what Guido said here on July 27, 2007:

    Q. I want to learn Python. Should I learn Python 2.6 or Python 3.0?

    A. Definitely learn Python 2.x (the latest version out is 2.5). I expect it'll be two years before you'll need to learn Python 3.0, and the differences aren't that great from a beginner's perspective: most of what you'll learn about 2.x will still hold about 3.0. Mid-2009 isn't so bad, and I think what he means is that's when operating systems will start including 3.x by default. Remember -- Guido works for Google now, and last I heard, Google was still using Python 2.2.
  138. This isn't new, I believe. by Zangief · · Score: 1

    I wasn't paying attention to Python back in the time, but wasn't Python 2.0 incompatible with Python 1.0?

    The changes in how scope worked must have surely broken things.

  139. Re:So, will it FINALLY have block structures? by Wheat · · Score: 1

    "You should NEVER read the Silly Parenthesis in LISP, that gets taken care of for you by any one of a gazillion tools."

    Tools do your reading for you? How does that work?

  140. Re:Python to not be backwards compatible by xtracto · · Score: 1

    I have a question, isn't Python a programming language? if it is true then what does backwards compatibility means? I mean, if it is going to have different syntax or sentence construction then it is another language, and I think they should not call it Python. It is like C++ and C# or logo /Starlogo/Netlogo they are different languages which have some common features, but are completely different things.

    The other issue is, isn't Python 2.0 an open source language (open specification and whatever), if that is true then i believe there is no problem of staying behind because even if the current maintainers start their new improved Python (Python++) a new community around Python can be created. It is like saying that C++ was going to mean the end of C99

    --
    Ubuntu is an African word meaning 'I can't configure Debian'
  141. Re:So, will it FINALLY have block structures? by Watts+Martin · · Score: 1
    I suppose the OP's point is that if you're typing Python code like:

    Class FoobarClass:
        def foo(x):
            return bar(x)
        def bar(x):
            return x*2
    A "smart editor" will know to indent on the second and fourth lines, after you've typed the colon, but it won't know when to unindent the way it would if it was doing brace matching. In other words, you can't just type code on autopilot: at the end of "return bar(x)" you have to hit RETURN BACKSPACE and to end the class you'll have to hit a whole RETURN BACKSPACE BACKSPACE series. Once the code is already indented correctly the editor can obviously preserve the semantic meaning, but there's no algorithmic way for the editor to re-indent code for you there way there is in a C-like language.

    Of course, I'd argue that the requirement a language be able to be re-indented algorithmically is actually the real religious issue.
  142. Re:#1 way to prevent adoption of new language vers by Anonymous Coward · · Score: 0

    (2) is a real usability problem: if you try to re-use an iterator,
    it simply produces nothing. This will catch many people many times,... It's only a problem insofar as it is a bad habit. If you want a reusable list, do:

    x = range(1000)
    for i in list(x):
        something
    for j in list(x):
        something

    In your case where you have a function that returns an iterator, you can simply replace list(x) with the function call foo(), and you get 2 iterators each starting at index 0. Maybe you should name x something more descriptive like iter?

    Iterators are great, in my opinion. Using an iterator instead of a list potentially saves lots of memory and potentially prevents expensive operations being performed until you actually need them to be.
  143. *don't* cut and paste large chunks of python code by Verte · · Score: 1

    I doubt any people that actually understand python have had problems in this regard. Cut + paste is not the major coding tool as it is in Java. If you're almost repeating code more than once, you need another level of abstraction. Also, if you're nesting deep enough for the indentation to be a problem, you should be breaking that up into functions.

    --
    We at slashdot are scientists, specialists and kernel hackers. Your FUD will be found out.
  144. Re:So, will it FINALLY have block structures? by ben+there... · · Score: 1

    The reason is obvious. Just ask the Fortran guys why they dropped semantic whitespace in the switch from fortran-77 to fortran-90.

    Whitespace shouldn't have semantic meaning because then you're stuck with semantic whitespace that might not be the easiest to read. For example, The following is MATLAB code specifying a 10x10 matrix that could be used for future calculations. Since this discussion is about Python, your example doesn't have any relevance. The only significant whitespace in Python is relative indent level, which is tokenized by the lexer in much the same way as curly braces are in other languages--to delineate blocks. Spaces within arrays/lists are not significant, except in string literals of course.
  145. Re: except that they do do short circuit by Anonymous Coward · · Score: 0

    Huh. huh. huh. He said "do do". /beavis

  146. Or Just Use Pascal Instead by maz2331 · · Score: 1

    VB:

    SUB MyFunc(ParmA as Integer)
        If ParmA = 1 then
            Call FuncB(ParmA)
        Else
            Call FuncC(ParmA)
        End If
    End Sub

    Or....

    procedure MyFunc (ParmA : Integer)

    begin
        if ParmA = 1 then
            FuncB(ParmA)
        else
            FuncC(ParmA);
    end;

    VB and Pascal are syntatically close enough that you can substitute one for another pretty easily. Then again, so is C compared to Pascal, except C is harder to read later.

  147. Re:For more info, check out... all this, but they by Anonymous Coward · · Score: 0

    apparently AIN'T gettin' rid-of the never-to-be-sufficiently-retyped "self."

  148. Not really a big deal by filbranden · · Score: 1

    This article is trying to imply that Python 3000 (that's what it's called right now) breaking compatibility will be as bad as Perl 6.

    But in fact, it's completely different. Perl 6 is actually a completely new language. They're replacing the basics, such as the "." operator, which used to be for string concatenation, and now is for accessing properties and methods of objects (like, they're trying to lose its C heritage and appeal to Java, .NET and Python programmers). There are other silly changes like this, that don't add any new features, they just change it because they thought it would look less ugly that way. On the other side, they didn't change Perl's most ugly side, which is that every variable is global by default! You have to use strict and my this my that... But the result is a language that still has the same shortcomings of Perl 5, and on the other hand, is completely different than Perl 5, in a way that you have to relearn everything you had learned before. If you want my opinion, Perl 6 will fail (not trolling here, just what I really think).

    On the other way, Python 3000 changes are on certain core elements, like strings, but the changes are made in a way that the language's general look and feel is still the same. In fact, many scripts will keep working as they are, and the most of those that will have to be changed will need only minimal adjustments. If you're proficient with Python 2 now, you'll probably be as proficient writing Python 3000 in less than an hour.

    As for Python 1.5 vs. Python 2, the backwards compatibility was kept. Though, many new constructions were introduced in Python 2, and the "preferred" way to do things changed. Python 2 has cleaner ways to do several common tasks, and the style of writing code actually changed significantly from 1.5 to 2, being much cleaner on 2. However, the 1.5 code kept working. From 2 to 3000, the change will be less in style and more in core concepts that will be reimplemented in a better way (like strings and classes), requiring to break the old and deprecated way to do that before.

    1. Re:Not really a big deal by chromatic · · Score: 1

      Perl 6 is actually a completely new language.

      Actually, it's not. Have you written any Perl 6 code?

      There are other silly changes like this, that don't add any new features, they just change it because they thought it would look less ugly that way.

      The justification for every change is publicly available in the appropriate Synopsis. Having written the minutes for nearly every Perl 6 design meeting for the past five years, I can't name one "silly change" made arbitrarily. I suspect you can't either.

      On the other side, they didn't change Perl's most ugly side, which is that every variable is global by default!

      Complete nonsense. That was one of the first changes to Perl 6.

      But the result is a language that still has the same shortcomings of Perl 5, and on the other hand, is completely different than Perl 5, in a way that you have to relearn everything you had learned before.

      Either one of us knows very little about Perl 6, or your use of the words "completely" and "everything" is very different from my understanding of those words.

      If you want my opinion, Perl 6 will fail (not trolling here, just what I really think).

      You have one of the simplest and earliest changes to Perl 6 completely backwards! Why should anyone believe anything more complex that you say about the language?

  149. Who cares || meaningless to start with by rockhome · · Score: 0, Troll

    I have used a lot of languages in my time time and when I was finally dragged, kicking, screaming, biting, and gnashing my teeth into perl, I thought perl was one of the worst languages ever provided to people who went to college and got some form of "MIS" degree. Then I took a job that had a bunch of stuff written in Python and I praised perl.

    Let's face it, Python is another step in the complete destruction of useful languages. Rather than force people to actually understand how things work, we now create "languages" that do everything for us. Perl and Python are not really languages. They are gigantic synonyms that insulate the user from anything remotely like what the underlying operating system or hardware is doing and it is debilitating innovation.

    There is nothing that I have ever written in Perl that I could not have accomplished in C using less memory and fewer CPU cycles. The same goes for Python.

    If you are interested in remaining ignorant and writing crap code in a crap grammar, great. Otherwise, who cares? Isn't Python 3.0 yet another conduit through which we can obfuscate"programming" and allow a community college 'MIS' major to claim he has the education as an MIT Computer Science graduate?

  150. Re:So, will it FINALLY have block structures? by mrvan · · Score: 1

    You mean that in python you hit ENTER BACKSPACE BACKSPACE while in C you hit ENTER CLOSE-CURLY ENTER? The reason why editors can't guess where to end your block is because that is a decision you have to make and signal to the editor. Whether the [CLOSE BLOCK] symbol is a curly brace or a backspace is not really that important now, is it?

  151. Re:Python to not be backwards compatible by fyngyrz · · Score: 1

    I read it. It's broken, won't run old code, it's 100% useless to me. There will be no porting. Incompatibly changing the print statement. How unbelievably ridiculous. It's the kind of thing you do when you have no users yet, not when there are untold numbers of people who trusted you.

    Really -- why not just say it has to run under AmigaDOS now, requires Fortran syntax, and be done with it? Wouldn't kill it any deader.

    --
    I've fallen off your lawn, and I can't get up.
  152. Re:Python to not be backwards compatible by m50d · · Score: 1

    As long as there are people using it support will continue, since a certain fraction of them will patch things. And writing modules yourself is quite straightforward, really (though why would you need to if this is old working code that you just want to keep working?)

    --
    I am trolling
  153. Re:Python to not be backwards compatible by tabrnaker · · Score: 1
    Do you know where you are?

    You're talking about technology and a scripting language.

    How long do you think you'll still be using the same scripts?

  154. Re:For more info, check out... all this, but they by PeterBrett · · Score: 1

    but they apparently AIN'T gettin' rid-of the never-to-be-sufficiently-retyped "self."

    You do realise you can use any variable name for the class reference, right? Calling it "self" is just a convention. In one piece of software I worked on, the convention was to call it "s".

  155. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 1

    The editor cannot possibly guess when to close a scope in 99% of the situations. Unless you have an über smart editor which needs you to input a formal specification of what your code is supposed to do and... hrm... no, actually... there is no possible way for an editor to do what you seem to want.

    As for you particular example, try it in vim: you will see that after a return, vim removes a level of indentation for you.

    People who argue against semantic indentation tend to be really really bad at providing examples, from what I can see...

  156. Re:Use by Intron · · Score: 1

    my bad.

    --
    Intron: the portion of DNA which expresses nothing useful.
  157. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 0

    How about this one: US-ASCII consists of 94 printable characters which are delivered reliably and 34 control characters which are frequently munged. Any Python code that goes through any tool (e.g., a Web forum) that doesn't preserve whitespace becomes ambiguous and unusable.

  158. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 1

    For your specific example: a web forum which does not preserve whitespace where it should is broken. So go fix it. The pre tag has been in HTML since its inception, for a reason.

    In any case, your argument is of very little weight. Any non-US-ASCII encoded text which goes through any tool which is not prepared to handle it will become useless quite soon (like anyone which an accent mark in his name, I can tell you) yet that's an absurd objection to, say, UTF-8.

  159. Re:So, will it FINALLY have block structures? by Anonymous Coward · · Score: 0

    a web forum which does not preserve whitespace where it should is broken

    They're all broken, including Slashdot (I tested ecode, because pre is simply ignored). So the Python fans' official solution is to boil the ocean rather than just add an option to support a less fragile syntax?

    As for using UTF-8 in the source of a script (not just supporting it in input and output), you'd be getting yourself into a world of pain. Seriously, test every tool any of your peers has ever considered using, and even after that you should expect things to randomly get transcoded or otherwise break. I wouldn't do that on a bet before 2012 or so. I still see screwed-up email from recruiters simply because my résumé was posted on my vanity site in UTF-8 (with the correct HTTP headers).

  160. Re:So, will it FINALLY have block structures? by msuarezalvarez · · Score: 1

    In the end, the issue comes down to whether people actually use the language and whether they find problems with this semantic-indentation-from-hell, and whether they even find pleasure in it.

    As for UTF-8, I have used UTF-8 in source code, and everywhere else for the last 7 or so years, and I have to have trouble with it.

  161. When porting is fun! by josepharmbruster · · Score: 1

    Writing programs in Python is fun. And as we very well know, happy developers are productive developers. I think the porting effort is going to be more fun for its developers than pain :-)

    Anyone else agree?

    --
    - The world is full of sleeping people... Too many sleeping people... very few wide awake.
  162. Re:So, will it FINALLY have block structures? by corbettw · · Score: 1

    Suppose I have some Python code, with my blocks indicated by tab characters. I now do a search and replace, replacing every tab with a {. Then I write some trivial code that searches through and sticks in a } wherever there is one less tab beginning a line than the line above. Quite often when I create dictionaries, I tab over to line up the keys and values to be indented from the name of the dictionary (and the initial { that sets the definition). Dealing with all of those tabs would add a certain level of complexity to your theoretical program mentioned above, and I'm pretty sure I'm not the only one out there who uses this style, I've seen similar uses of tabs and whitespace in many programs.

    Not saying it would make it impossible, just listing another instance where switching out tabs with braces will be a pain.
    --
    God invented whiskey so the Irish would not rule the world.