Beta

Slashdot: News for Nerds

×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

The Evolution of Python 3

ScuttleMonkey posted more than 5 years ago | from the all-growd-up dept.

Programming 215

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

cancel ×

215 comments

I knew it! (-1, Offtopic)

Anonymous Coward | more than 5 years ago | (#26422997)

Hah! Evolution! I knew that an Intelligent Designer couldn't have been behind Python 3.0!

I agree.... (1)

mangu (126918) | more than 5 years ago | (#26424289)

There's no way an Intelligent Designer could think that

>>>print(format(10.0, "7.3g"))
              10

is a clearer syntax than

>>> print '%7.3g' % 10.0
          10

Of course, raw beginners don't know that % means format, but there was a time when I didn't know that / means division either. Will they deprecate all operators because they might confuse a beginner? I think there should be some reasonable limits to that everything-is-an-object thing.

Re:I agree.... (0)

Anonymous Coward | more than 5 years ago | (#26424395)

results = "%7.3g" % 10.0
print(results)

Re:I agree.... (1)

spiralx (97066) | more than 5 years ago | (#26425125)

Or use

print("7.3g".format(10.0))

like every normal person would.

Combine them.... (4, Funny)

thetoadwarrior (1268702) | more than 5 years ago | (#26423003)

and make everyone happy with Python 5.6

Re:Combine them.... (3, Funny)

morgan_greywolf (835522) | more than 5 years ago | (#26423055)

Lemme guess... you're a student of the Sun Microsystems'-sponsored Bill Joy School of Version Numbering?

Re:Combine them.... (4, Funny)

Radish03 (248960) | more than 5 years ago | (#26423259)

Either that or he's a Winamp developer.

Re:Combine them.... (2, Funny)

morgan_greywolf (835522) | more than 5 years ago | (#26423559)

Same thing.

Roland Piquepaille: a case study in madness (-1, Troll)

Anonymous Coward | more than 5 years ago | (#26423011)

I think most of you are aware of the controversy surrounding regular Slashdot article submitter Roland Piquepaille. For those of you who don't know, please allow me to bring forth all the facts.

Roland Piquepaille has an online journal. (I REFUSE TO USE THE TERM 'BLOG'). It consists almost entirely of content, both text and pictures, taken from reputable news websites and online technical journals. He does give credit to the other websites, but it wasn't always so. Only after many complaints were raised by the Slashdot readership did he start giving credit where credit was due.

Roland Piquepaille's Technology Trends serves online advertisements through a service called Blogads, located at www.blogads.com.

Before we talk about money, let's talk about the service that Roland Piquepaille provides in his journal. He goes out and looks for interesting articles about new and emerging technologies. He provides a very brief overview of the articles, then copies a few choice paragraphs and the occasional picture from each article and puts them up on his web page. Finally, he adds a minimal amount of original content between the copied-and-pasted text in an effort to make the journal entry coherent and appear to add value to the original articles. Nothing more, nothing less.

Now. Let's HIT THIS FUCKER WHERE IT HURTS and talk about money.

It appears that every single article submitted to Slashdot by Roland Piquepaille is accepted, and he submits multiple articles each month. As of today, it is clear that ten articles were accepted in October, six in November, and four in December (so far). See http://slashdot.org/~rpiquepa for yourself. Some generate lots of discussion; others very little. What is clear is that, on a whole, this generates a lot of traffic for Roland Piquepaille. Just over 150000 hits each month according to Blogads. And the higher the traffic, the higher the advertisement rates Roland Piquepaille can charge. So, why do the Slashdot editors accept every single story from Roland Piquepaille? Is the content of his journal interesting and insightful? Of course it is, but not by Roland Piquepaille's doing. The actual content of his journal is ripped from the real articles, but at least he gives them credit now. Does the content of his journal bring about energitic discussion from the Slashdot readership? Yes, because the original articles from which he got his content are well written and researched and full of details. So you may be asking, "What is so controversial about this?" Well, in almost every single article submitted by Roland Piquepaille, Slashdot readers complain that Roland Piquepaille is simply plaigarizing the original articles.

Slashdot should instead link to the original articles. In essence, avoid going through the middle man (and making money for him!). The Slashdot readership that can see through Roland Piquepaille's farce objects on the basis that he stands to make a generous amount of money by doing very little work and instead piggy-backing on the hard work of other professional writers. Others argue that he is providing us with a service and should not be ashamed to want to get paid for it. But exactly what service is he providing us with? He copies-and-pastes (copy-pasta faggotry)the meat of his journal entries from professional and academic journals and news magazines and submits about seven or eight of these "articles" to Slashdot each month. Is this "service" worth up to $647 a month?

Or, does each "article" represent up to $80 of work? You decide.

Re:Roland Piquepaille: a case study in madness (4, Funny)

Anonymous Coward | more than 5 years ago | (#26423027)

I don't think will be a problem any more

Re:Roland Piquepaille: a case study in madness (-1, Offtopic)

andymadigan (792996) | more than 5 years ago | (#26423475)

I was with you until you turned into a biggot (faggotry). Instead, I think you should get an education and grow up.

Re:Roland Piquepaille: a case study in madness (0)

Anonymous Coward | more than 5 years ago | (#26423887)

You mean you dropped him just because of that? Go out and live a bit.

Re:Roland Piquepaille: a case study in madness (0)

Anonymous Coward | more than 5 years ago | (#26424153)

I believe the Slashdot editors collect a good deal more than $80 per article, and they just copy and paste a summary. Roland made it easier by copying whole articles, whereas the Slashdot editors leave that to the karma whores and kind ACs.

Evolution? (2, Funny)

El_Muerte_TDS (592157) | more than 5 years ago | (#26423013)

Shouldn't that be intelligent design? Otherwise we'd have way more python flavors.

Re:Evolution? (1)

Abreu (173023) | more than 5 years ago | (#26423075)

Well, Python has a distinct, well known creator, so I guess it does qualify

Re:Evolution? (0)

Anonymous Coward | more than 5 years ago | (#26423117)

No, because there's a very limited amount of resources available so all the weaker variations quickly died off.

Re:Evolution? (1, Insightful)

Anonymous Coward | more than 5 years ago | (#26423445)

Can't evolution be controlled? I guess that is the same basic idea as in intelligent design, but it can be called evolution even though somebody steers where it's heading.

Re:Evolution? (0)

Anonymous Coward | more than 5 years ago | (#26423915)

Erm, it's called selective breeding (or artificial selection), and it's been going on for about 10,000 years.

Re:Evolution? (1)

Anthony_Cargile (1336739) | more than 5 years ago | (#26423685)

It depends on if Python can actually fork() on Windows yet without using Cygwin.

Re:Evolution? (0)

Anonymous Coward | more than 5 years ago | (#26424165)

Only apps that utilize the POSIX subsystem on Windows can call fork().

(Trivia: Even Windows 7 still comes with the OS/2 subsystem. Look for a file called os2ss.exe)

Re:Evolution? (2, Interesting)

Anthony_Cargile (1336739) | more than 5 years ago | (#26425287)

Hmm, thanks for that little tip. I still have the leaked NT code from around 2004, and linking to that (granted it remained the same) might just be a good practice for some POSIX-esque cross-windows features, perhaps even undocumented, in future apps. Thanks!

Re:Evolution? (1)

wilder_card (774631) | more than 5 years ago | (#26423691)

There were a lot more flavors, but 3.0 and 2.6 ganged up and ate them all. Don't even ask about poor version 3.14159...

Re:Evolution? (2, Funny)

Shadow Wrought (586631) | more than 5 years ago | (#26425845)

Don't even ask about poor version 3.14159...

I hear it bit its tail and now just slowly slithers around in a circle...

Re:Evolution? (1)

flyingfsck (986395) | more than 5 years ago | (#26424015)

"Python species"

There, fixed it for you! ;)

Probably not an issue for beginners? (2, Interesting)

NinthAgendaDotCom (1401899) | more than 5 years ago | (#26423083)

I just started learning Python a few weeks ago when I got laid off from my QA job. I imagine I'm not to the point yet where the language differences between 2.x and 3.x are going to matter?

Re:Probably not an issue for beginners? (3, Informative)

morgan_greywolf (835522) | more than 5 years ago | (#26423119)

Unless you're trying to learn how to code Django apps, which won't work on Python 3.0. Neither will a lot of other 3rd party modules.

Re:Probably not an issue for beginners? (0)

Anonymous Coward | more than 5 years ago | (#26423189)

Almost no significant third party modules work with Py3k, particularly those that rely on C extensions. No wxPython, no Twisted, etc. That's the only reason I'm using 2.6 (and I still have to compile a Win32 binary for pyOpenSSL myself).

Re:Probably not an issue for beginners? (1)

morgan_greywolf (835522) | more than 5 years ago | (#26423233)

No Twisted? Well, no Python 3.0 for a bunch of my apps for a while...I did mention Django, though, specificially because the Django devs have no definitive plans to update it 3.0 at this time and it's not inconceivable that they might never update it for 3.0.

Re:Probably not an issue for beginners? (1)

ultrabot (200914) | more than 5 years ago | (#26423697)

No Twisted? Well, no Python 3.0 for a bunch of my apps for a while...I did mention Django, though, specificially because the Django devs have no definitive plans to update it 3.0 at this time and it's not inconceivable that they might never update it for 3.0.

Sounds like FUD - Django will update to 3.0, it will just take time:

http://docs.djangoproject.com/en/dev/faq/install/#can-i-use-django-with-python-3-0

The upgrade won't be exceedingly hard either. It could be done people not part of the django core team, even... Summer of code 2009?

Re:Probably not an issue for beginners? (-1, Troll)

Anonymous Coward | more than 5 years ago | (#26425479)

And how is that even relevant to learning Python, oh trolling furry freak? Answer? It's not, of course. Django will be updated to support Python 3.0, and in the meantime their OWN FUCKING PAGE recommends that you still use Django and learn on 2.5.x until the transition is made.

Why don't you go back to wanking in your fursuit where you aren't interacting with the real world?

Re:Probably not an issue for beginners? (3, Informative)

Random BedHead Ed (602081) | more than 5 years ago | (#26423139)

Not really. Keep learning 2.x as you were. Quoth Guido:

http://www.artima.com/weblogs/viewpost.jsp?thread=211200 [artima.com]

Ignore 3.0 for now. If you encounter it, there is a handy script to help update your code, though most of the language is unchanged. The biggest gotcha is that print is now a function print() rather than a statement.

Re:Probably not an issue for beginners? (1)

TheoMurpse (729043) | more than 5 years ago | (#26425377)

Oh darnit. I've been programming amateurely (as an amateur?) for twenty years, starting with BASIC as a kindergartener or preschooler.

I've always disliked print() and preferred print as a statement. Likely because of my background in BASIC and the fact that I learned C++ and cout before I learned C and printf().

Can someone tell me why it was changed to print()? Philosophical reason or pragmatic? Just to conform with the more popular Java/JavaScript/C convention or something?

Re:Probably not an issue for beginners? (1)

hobbit (5915) | more than 5 years ago | (#26425675)

Why should print have special status as an operator? cout doesn't.

Re:Probably not an issue for beginners? (1)

Mozk (844858) | more than 5 years ago | (#26425635)

The biggest gotcha for me was that sockets now use byte arrays instead of strings.

Re:Probably not an issue for beginners? (1, Insightful)

Anonymous Coward | more than 5 years ago | (#26425819)

That link is 18 months old, in which he says "I expect it'll be two years before you'll need to learn Python 3.0", so if he followed the advice he should start learning 3.0.

Re:Probably not an issue for beginners? (2, Interesting)

joetainment (891917) | more than 5 years ago | (#26423157)

They will matter a little bit. Some very basic things (like the way the print function works) have changed. However, there's plenty of information on their website, and they've made tools to make migration easier. Those little problems should be easy enough to work around if you use 3.x, or you could keep using 2.x for a while until everything else catches up.

Trip over beginners? (3, Funny)

AaxelB (1034884) | more than 5 years ago | (#26423103)

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

Ah, yes, I remember python tripping over me. It's actually pretty impressive that a snake figured out how to trip, why take out that feature? It seems like you're knocking it back a notch in the evolution toward legs.

Re:Trip over beginners? (1)

VirusEqualsVeryYes (981719) | more than 5 years ago | (#26423489)

So if you are not held back by external requirements like dependencies on packages or third party software that hasn't been ported to 3.0 yet or working in an environment where everyone else is using another version. If you're learning Python for the first time, 3.0 is a great way to learn the language. There's a couple of things that trip over beginners have been removed.

Like basic grammatical structure, for instance? When did Palin become a Python dev?

Re:Trip over beginners? (0)

Anonymous Coward | more than 5 years ago | (#26423491)

First Ruby on Rails, now Python on Legs. What next?

Re:Trip over beginners? (4, Funny)

lewp (95638) | more than 5 years ago | (#26423551)

Well, Common Lisp stole my bike.

Im working on a Python clone (0, Redundant)

Daswolfen (1277224) | more than 5 years ago | (#26423125)

I call it Monty:Python

Re:Im working on a Python clone (2, Informative)

LighterShadeOfBlack (1011407) | more than 5 years ago | (#26423231)

The name Python originally came from Monty Python, so you're about 18 years late on that joke.

In all seriousness (0, Flamebait)

jgtg32a (1173373) | more than 5 years ago | (#26423323)

Is there a Python clone that uses C style formating?

Maybe I'm just whiny, but the braces and everything are just easier to read.

Re:In all seriousness (2, Insightful)

bb5ch39t (786551) | more than 5 years ago | (#26423509)

I don't think so. One of the design ideas for python, IIRC, was to force "proper indentation" for "proper documentation".

Re:In all seriousness (2, Insightful)

Anonymous Coward | more than 5 years ago | (#26423531)

I thought the same as you once, but I changed my mind. Now the braces just plainly, insanely annoy me.

Moreover, you cannot imagine how much time is wasted in typing something that has absolutely no meaning: you have to indent anyway. Braces are just a waste of your time.

Re:In all seriousness (3, Insightful)

AuMatar (183847) | more than 5 years ago | (#26423957)

On the other hand, I've spent at least a full work week of my life fixing problems due to whitespace. Guido made a major fuck up there- by removing braces but not strictly defining whitespace, he's created a language where it's possible to have two identical looking pieces of code do very different things. If he had said that it must be indented by exactly 1 tab or exactly 4 spaces or whatever other measure and everything else would throw a syntax error, it would have been fine. As it is I'd say about 15-20% of the time I spent doing Python was spent fixing these kinds of bugs.

Re:In all seriousness (3, Insightful)

Anonymous Coward | more than 5 years ago | (#26424175)

I think it's ridiculous that people's biggest complaint about Python is that it's whitespace sensitive. Any frustrations with it are easily solved by using the proper tools.

Learn a text editor, and this isn't an issue. In emacs, C-c C-q will properly tabify the function you're in, and tabs should behave mostly sane thereafter.

Re:In all seriousness (0, Troll)

AuMatar (183847) | more than 5 years ago | (#26424773)

I think that it's ridiculous that a language's readability depends on the tool used to read it. It's a sign the language is broken. A proper language would use an easily distinguishable delimeter- anything other than a whitespace. It could be { [ ( or (@$^(*#*@(&#*(@&#^& for all I care. If you need a special tool to read it, its flawed. I should be able to write my code in emacs, vi, nano, pico, ed, or notepad for that matter without having to spend any time messing with the setup. And my coworkers should be able to use whatever tool they want, even if they are heretical vi users. Nor should I have to know the 1 billion features of emacs. I have better things to waste braincells on.

By the way, what would you do if you were in an environment that didn't have emacs- say editing on an embedded/mobile device? Or were working off of printouts? Or just didn't have it on the machine and couldn't install it (no network, network outage, improper permissions)?

I also love that they should behave "mostly sane" thereafter. So even with tools it isn't promised to work right? No thanks.

And I am speaking from experience here- I worked on a Python project in a team environment. It was a disaster, the whitespace thing caused daily bugs. There's no excuse for the amount of time and productivity it caused us to lose when the solution exists and is 4 or 5 decades old.

Re:In all seriousness (1)

DragonWriter (970822) | more than 5 years ago | (#26425037)

A proper language would use an easily distinguishable delimeter- anything other than a whitespace.

All programming languages higher level than machine code that I've encountered, except for a few esolangs, use whitespace as a delimiter.

Re:In all seriousness (4, Insightful)

horza (87255) | more than 5 years ago | (#26425137)

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

Phillip.

Re:In all seriousness (0)

Anonymous Coward | more than 5 years ago | (#26425695)

I think that it's ridiculous anyone still mods you up, it's so obvious that you're trolling it's...well...ridiculous. The more people criticize your opinion the more inflated and retarded your claims about loss of "productivity" due to fucking WHITESPACE become. If the "whitespace thing caused daily bugs" in your little band of fake Python developing friends it was because they weren't fucking writing in the language properly, or they didn't know how to make a straight, vertical line out of familiar keyboard characters. Either way the problem seems to be their stupidity rather than a problem with the language. "No excuse," blah blah blah blah. You probably just got done doing your BSD is dead cut-and-paste job on a GNAA forum you dumb fuck. No one's falling for it any more.

Re:In all seriousness (2, Insightful)

Moebius Loop (135536) | more than 5 years ago | (#26425045)

I would be interested to see an example of Python code where a change to whitespace causes two identical-looking pieces of code to do two different things.

The only issues that *ever* come up in such a scenario is a SyntaxError, and pretty much the only reason they ever happen en masse is due to indiscriminate copy-and-paste coding.

Syntax errors can barely even be called bugs, and in any significant project the amount of time you're going to spend dealing with them is easily dwarfed by the *real* bugs that are a natural part of the development process.

If developers are spending a truly inordinate amount of time on whitespace issues, it can only be due to lack of discretion and attention to detail, which I would be willing to wager is increasing the number of "real" bugs emerging as well.

Re:In all seriousness (4, Informative)

AlexMax2742 (602517) | more than 5 years ago | (#26425437)

There is a standard [python.org]

Re:In all seriousness (4, Insightful)

SleepingWaterBear (1152169) | more than 5 years ago | (#26425451)

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

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

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

Re:In all seriousness (0)

Anonymous Coward | more than 5 years ago | (#26425557)

Care to provide an example of said code that looks identical but does two completely different things, perhaps? Because I couldn't do it.

i=1
while i==1:
  print "test"
  i = 2

output: test

i=1
while i==1:
    #note the extra space for the retarded
    print "test"
    i = 2

output: test

As it is, I'd say you're full of shit and you're just a freak for another language trolling this thread, but hey. Everyone's entitled to their opinion. Even if it's stupid.

Re:In all seriousness (1)

hobbit (5915) | more than 5 years ago | (#26425731)

I agree. I'm a Python fan but "use a proper text editor" is passing the buck big-style. Guido should have just mandated the use of spaces rather than tabs: everything renders spaces the same.

Re:In all seriousness (0)

Anonymous Coward | more than 5 years ago | (#26426011)

This is a serious issue that seems to get dismissed regularly by the Python crowd. As you pointed out the issue is the definition of white space and like you have experienced this debugging nightmare myself.

It is especially troublesome when using code from a third party written in an unknown editor. Basically one needs to have the editor you are using set up to display the various white spaces in differing colors or in other manners so that you can visually see where your code blocks should be. Worst is the cut and paste from one source into another.

You also hinted on the solution here to the problem that would be a clear and unambiguous definition as to what is white space. Given that it wouldn't take much for a good editor programmer to come up with a really helpful Python mode.

Re:In all seriousness (0)

Anonymous Coward | more than 5 years ago | (#26423745)

You could try "from __future__ import braces", but I get the funny feeling this won't be implemented any time soon. Call it a hunch.

Re:In all seriousness (5, Funny)

ultrabot (200914) | more than 5 years ago | (#26424149)

Yes.

Example program:

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

Re:In all seriousness (1)

KovaaK (1347019) | more than 5 years ago | (#26424191)

Sweet. Now with all that work that you've done in getting python to support braces, can you make it not depend on whitespace? I'm sure it won't take that much more effort.

Re:In all seriousness (1)

ultrabot (200914) | more than 5 years ago | (#26424321)

can you make it not depend on whitespace? I'm sure it won't take that much more effort.

It would be easy to create a preprocessor to do that, but life's too short. I'll leave the excercise to someone that cares enough.

Compatibility (-1, Flamebait)

Anonymous Coward | more than 5 years ago | (#26423221)

Python lost me the moment they decided to break almost every script in existence just to satisfy their egos and have a nicer language. I used a lot of Phython before but if the developer care more for the beauty of the langage than for the users I'm off.

Mmm nothing like a fresh tranny bottom (-1, Offtopic)

Anonymous Coward | more than 5 years ago | (#26423225)

There is nothing like sticking a nice cock inside of a hot tranny's smooth bottom in the evening while you reach around and give a handjob. You slashdotters
should try it some time. They give especially good head. When you blow your load inside a tranny bitch it's like the closest slashdot experience of having a girlfriend.
I recommend the buttsex.

Re:Mmm nothing like a fresh tranny bottom (0)

Anonymous Coward | more than 5 years ago | (#26424505)

just be careful. I tried to pick up a tranny a couple weeks ago. Turned out he was just a crossdresser. Very embarrassing for both of us.

Getting into Python 3 (4, Informative)

dedazo (737510) | more than 5 years ago | (#26423237)

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

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

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

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

This sentence fragment. (2, Funny)

HTH NE1 (675604) | more than 5 years ago | (#26423267)

So if ( you are ( not ( held back by ( external requirements like ( dependencies on packages ) or ( third party software that hasn't been ported to 3.0 yet )))) or ( working in an environment where everyone else is using another version )).

The above sentence fragment is apparently a verbal quotation where Guido van Rossum forgot he used the word "if" when he was somewhere in the middle.

Re:This sentence fragment. (1)

MichaelSmith (789609) | more than 5 years ago | (#26423379)

Its going to be a pain getting the indenting right in there.

Re:This sentence fragment. (1)

HTH NE1 (675604) | more than 5 years ago | (#26423673)

Yeah, I thought about indenting it python-style (after I'd already hit Submit, natch) but it would be harder to read wrapped in <ecode></ecode> .

And I should have had another set of parentheses around "( dependencies on packages ) or ( third party software that hasn't been ported to 3.0 yet )" to associate it stronger with "like".

Re:This sentence fragment. (1)

atraintocry (1183485) | more than 5 years ago | (#26423705)

If you code in Notepad, maybe :)

Unicode & toolkits (1)

ultrabot (200914) | more than 5 years ago | (#26423473)

Python 3 mostly changes things that deal with unicode (i.e. it uses unicode an it's "text" object, like Java).

If you don't care about unicode that much (e.g. you mostly deal with development tools, iso-latin1/ascii encoded files...) there is absolutely no rush to hop on the bandwagon. And perhaps you just hate unicode as a concept ;-).

I predict that the bandwagon will start rolling ~ Q2 / 2009, when toolkits like PyQt4 for 3.0 are materializing.

Mostly? There's a lot else (1)

xant (99438) | more than 5 years ago | (#26424393)

Of course the list would be pretty long (good thing I don't have to list it [python.org] ), and of course Unicode is very significant, but I think there are other things just as significant if not more. Example: everything's an iterator now, not just a list.

BTW, Python 2.x has all the unicode support you need to write a correct application. You just have to use u'unicode strings' instead of 'strings' in a lot more places. Python 3.0 has just switched the default, which will make it easier for application developers to get it right. And that's VERY important. In both versions you have to think about encodings.

My prediction is about 18 months before Python 3.0 is considered the default. My team, in general a pretty early adopter of technology, won't be using it for at least 9 months, waiting for our dependency stack to fill in.

My fulltext search library, Hypy [goonmill.org] , on the other hand, should have Python 3.0 support any day now.

Oh good. (4, Insightful)

powerlord (28156) | more than 5 years ago | (#26423549)

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

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

Re:Oh good. (5, Insightful)

SatanicPuppy (611928) | more than 5 years ago | (#26424053)

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

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

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

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

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

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

Re:Oh good. (5, Insightful)

hwyhobo (1420503) | more than 5 years ago | (#26424245)

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

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

I guess it is a matter of priorities.

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

Re:Oh good. (1)

salimma (115327) | more than 5 years ago | (#26424605)

Copy-and-pasting is problematic too, because the pasted code might (in fact, is likely to) end up at the wrong indentation level.

Re:Oh good. (1)

garaged (579941) | more than 5 years ago | (#26424641)

that's why python (and most programming languages) promote the DRY filosophy [slashdot.org]

Re:Oh good. (1)

hwyhobo (1420503) | more than 5 years ago | (#26424839)

While the DRY philosophy may be quite useful in large programs, in small utilities, particularly if they do not necessarily run on the same system, attempting to "librarize" or "functionize" everything may not be practical, and may in fact defeat the readability of your code (of which Python is proud), and also introduce unnecessary bloat.

Just the fact that you have to fear copy & paste is an indicator of bad design to me.

Re:Oh good. (1)

robot_love (1089921) | more than 5 years ago | (#26425721)

Wow. I've read a lot about coding and programming, but that's the first time I've ever seen someone claim that a programmers reluctance to copy and paste was a bad sign.

Methinks you have chosen a rather strange hill to die on...

Re:Oh good. (1)

hwyhobo (1420503) | more than 5 years ago | (#26425743)

Huh? I think you've read into my post what you wanted, not what it said.

Re:Oh good. (1)

hwyhobo (1420503) | more than 5 years ago | (#26425787)

Besides, this is getting seriously off-topic, so I will continue it (if you wish) when a more suitable thread arises.

Re:Oh good. (4, Insightful)

costas (38724) | more than 5 years ago | (#26424821)

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

Re:Oh good. (1)

hwyhobo (1420503) | more than 5 years ago | (#26425469)

Both are much less common than looking at badly-formatted code that it takes a bit to mentally parse which brace-delineated languages have.

There is nothing that prevents an organization from instituting coding standards, just like Technical Publications and Marcomm groups have their own Writing Standards (Guides). It is up to the management to punish non-adherence. However, breaking the program by design because someone missed the number of spaces or copied & pasted a few lines of code just rubs me the wrong way.

YRMV, of course.

Re:Oh good. (1)

jellomizer (103300) | more than 5 years ago | (#26425717)

I was always a fan of the white space.
Having worked with a lot of languages. Forcing good form is actually a nice feature, when the language doesn't enforce proper layout of application of any size will undoubtedly start getting sloppy. Adding an If statement or a while loop as a bug fix and not taking time to properly indent is quite common. And over say 20 years life span of an application, those simple fixes become sloppy code that is hard to read.

Re:Oh good. (1)

Jeremi (14640) | more than 5 years ago | (#26426245)

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

I suppose there is no reason someone couldn't write some SVN hooks that would automatically add curly braces to Python code as it was being checked out from the repository, and automatically remove them again (and correctly indent the text) as Python code was being checked back in. And, of course, update the Python interpreter with a flag to optionally require curly braces instead of indentation, as a way of delimiting blocks of text.

Given that, everybody could use their own favorite method of code formatting...

Re:Oh good. (1)

larry bagina (561269) | more than 5 years ago | (#26424983)

indent(1) much?

The python FAQ's explanation for whitespace block levels is basically that braces/indentation might confuse you. Well, braces don't confuse me. But if you're going to pretend whitespace block indentation is good, then VB-style WHILE ... END, IF .. END IF, etc must be even better.

Re:Oh good. (1)

drauh (524358) | more than 5 years ago | (#26425671)

uh, no. whitespace block indentation means blocks have no delimiters. using "END IF" etc means you're adding a closing delimiter. python says: you don't need it.

really, though, this stuff is minor. any good editor will handle all this for you, whether with braces or without. the other language i like is LISP, which is diametrically opposite python in its use of ()s everywhere.

Re:Oh good. (1)

Kingrames (858416) | more than 5 years ago | (#26424063)

No,theyremovedthewhitespace,butdidn'taddanybraces.

Unfortunately not (1)

mangu (126918) | more than 5 years ago | (#26424705)

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

No, unfortunately they did the worst thing they could do in that respect. Nearly all the changes introduced will make longer lines of code. I think they are trying to make sure that you will need to use the line continuation backslash, which completely negates the advantages of whitespace formatting.

It seems that their definition of "clean syntax" is Java-like, rather than Perl-like. I never went to the extreme of playing "Perl Golf" [wikipedia.org] , but a concise syntax is one of the best ways to make readable code. I started using C rather than Pascal because of that. I switched from Perl to Python when I rewrote some Perl programs in Python and realized that, despite the somewhat longer code, Python was clearer to read. But I still miss the =~ regular expression match operator from Perl.

An optimal programming language should be well balanced. Not like APL, where a page of code can be resumed to a single character, but it's like learning to write in Chinese. Not like Java either, where you must write several pages of declarations before anything useful comes out. C is very close to the ideal, if you take the effort to understand how a computer works before you start to program. Perl is pretty good, if you resist the temptation to show off your ability. Python was almost there, the perfect compromise between readability and conciseness. Until 3.0, when they went astray...

I love Python. I hate Py3k.

Backwards Compatibility (2, Interesting)

zwekiel (1445761) | more than 5 years ago | (#26423627)

I think that whenever a group releases a new version of their language, they should strive to make it (mostly) backwards compatible. Not only does Python 3.0 change the way things work in relation to specific function, but it also removes specific language conventions and creates new ones in their places. This means that very large projects have a lot of work to do to bring their project over to the new specification.

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

</my two cents>

Re:Backwards Compatibility (5, Interesting)

ultrabot (200914) | more than 5 years ago | (#26423905)

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

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

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

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

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

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

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

Re:Backwards Compatibility (1)

MSG (12810) | more than 5 years ago | (#26424323)

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

Not to mention Perl4 -> Perl5.

Re:Backwards Compatibility (1)

negative3 (836451) | more than 5 years ago | (#26426193)

Backwards compatibility is good but it was never a part of the plan for Python 3 from the beginning - that was declared from the start and has been known for years. 2.6 and 3.0 were released close to each other. The biggest worry I have is that 3.0 is SLOWER than 2.6 in the benchmarks I have seen.

Correction to Title (0)

Anonymous Coward | more than 5 years ago | (#26423803)

The Intelligent Design of Python 3

Are distributions going to permit both at once? (1, Interesting)

Anonymous Coward | more than 5 years ago | (#26424029)

Are Linux distributions that include packaged python versions and apps going to permit both 2.x and 3.x python versions to co-exist so all the apps (including local additions) don't have to be ported on the same day?

Re:Are distributions going to permit both at once? (2, Informative)

joe_cot (1011355) | more than 5 years ago | (#26424277)

I currently have both python2.4 and python2.5 installed in Ubuntu. They're different packages, and can easily be installed alongside each other.

For distributions with dependency management (Ubuntu, Debian, Fedora, any modern distribution), this isn't a hard issue -- in the distros I'm familiar with (Debian/Ubuntu) the different versions of python are just separate packages, apps have a list of dependencies and can list that they depend on a certain version of python, and the python package is just a dummy package that "depends" on the latest version of python.

The same thing is done with different versions of Java, GTK, etc. When a toolkit or language makes a huge backward-incompatible change, it's rare that they can't just be installed alongside each other. Different 2.x versions of Python work just fine alongside each other, and I don't see how Python 3 would be any different.

Cue whitespace ranting from wannabees (0, Flamebait)

Qbertino (265505) | more than 5 years ago | (#26424221)

We've heard it all. Cut it out allready. Those ranting about Pythons whitespace are the ones that don't know what they are talking about because they have *never* even programmed in Python, and if it only were for half an hour. To all you suckers out there: Freaking write at least one simple bubblesort in Python, before you go out on a limp and talk about stuff you don't know.

Re:Cue whitespace ranting from wannabees (1)

larry bagina (561269) | more than 5 years ago | (#26424533)

So if someone [goatse.cz] on the internet told you that stretching your ass felt good, would you do it? Or would you consider your own experiences and preferences?

Re:Cue whitespace ranting from wannabees (0)

Anonymous Coward | more than 5 years ago | (#26425861)

Actually popular literature [amazon.com] suggests that constricting, not stretching, your anus is the key to "good-bying depression".

Best scify movie, eveh! (0, Offtopic)

Gilmoure (18428) | more than 5 years ago | (#26424623)

Python vs. Mansquito III!

ie (0)

Anonymous Coward | more than 5 years ago | (#26425725)

import evolution

Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Create a Slashdot Account

Loading...