The Evolution of Python 3
chromatic writes to tell us that O'Reilly has an interview with Guido van Rossum on the evolutionary process that gave us Python 3.0 and what is in store for the future. "I'd like to reiterate that at this point, it's a very personal choice to decide whether to use 3.0 or 2.6. You don't run the risk of being left behind by taking a conservative stance at this point. 2.6 will be just as well supported by the same group of core Python developers as 3.0. At the same time, we're also not sort of deemphasizing the importance and quality of 3.0. So if you are not held back by external requirements like dependencies on packages or third party software that hasn't been ported to 3.0 yet or working in an environment where everyone else is using another version. If you're learning Python for the first time, 3.0 is a great way to learn the language. There's a couple of things that trip over beginners have been removed."
Hah! Evolution! I knew that an Intelligent Designer couldn't have been behind Python 3.0!
and make everyone happy with Python 5.6
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.
Shouldn't that be intelligent design? Otherwise we'd have way more python flavors.
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?
-- http://ninthagenda.com/
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.
I call it Monty:Python
Don't rush me, Sonny. You rush a miracle man, you get rotten miracles.
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.
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.
For those interested, IBM is running a primer series on the new language/runtime features.
There's also this older (but still relevant) PEP that explains things that did not change between the 2.x series and 3.0.
Personally, I'm not looking forward to migrating existing code bases (especially non-trivial ones) to 3.0, but I'm planning to do all new development against it (of course assuming that the various packages I use have ports).
For Python trivia lovers, here the the actual moment in time when 3.0 was let loose on the world. I'm such a sentimental geek :)
Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
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.
Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
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.
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.
Save your wrists today - switch to Dvorak
So whitespace block delineation is finally out, in favor of braces? :P
This space for rent. All reasonable inquiries will be entertained at proprietors discretion.
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>
Web Hosting: Unlimited storage and bandwidth: $5/month
The Intelligent Design of Python 3
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?
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.
We suffer more in our imagination than in reality. - Seneca
There's no way an Intelligent Designer could think that
is a clearer syntax than
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.
Of course the list would be pretty long (good thing I don't have to list it), 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, on the other hand, should have Python 3.0 support any day now.
It's rare that you're presented with a knob whose only two positions are Make History and Flee Your Glorious Destiny.
Python vs. Mansquito III!
I drank what? -- Socrates
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", 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.
import evolution
Can't evolution be controlled?
Of course it can. But then it isn't "evolution" in the religious sense that hard core atheists insist on. The official Dogma explicitly requires *undirected* chance plus natural selection as the ultimate origin of anything that appears to be designed. (Notice I said, "ultimate", nitpickers.)
I mean really, philosophical materialism is just as silly as the "the universe must have been created in 7 revolutions of a certain planet as measured 14 billion (or 6000) years into its evolution" camp. ("Evolution" in the continuous change according to a set of rules sense). Did they ever consider that our physical time was itself one the things being (allegedly) created? (Many Church Fathers did - e.g. Augustine)
There are many meanings of "evolution" in common use, so discussions always end up in equivocation with straw and torn blue jeans all over the place.
for whitespace bugs in python. If your programmers insist on using their own personal editors with their own personal tab expansion preferences - then ban tabs. All fixed. Easily automated. Use a CVS script to reject *.py with tab chars.
I have also been bitten by C bugs caused by white space. Someone with a different tab stop had entered the code incorrectly, but it looked correct in my editor (with standard unix 8 space tab stops). Never did notice the misaligned brace until running it through pretty print...
Um my bad on starting this little flame war I had no idea.
I posted about this before in a previous Python 3.0 article and a lot of people attacked me. However I very much feel that Pythons treatment of Unicode as UTF-16 is a HUGE problem that will cause no end of pain. I think a far cleaner solution to Unicode is to do the following:
- Make unmarked plain quoted strings produce byte strings just like they do now. Unless there are backslashes, the contents are precisely the bytes that are in the input file. Keep the automatic casting of byte strings to unicode strings.
- Force the encoding to be UTF-8 by default, or at least make it trivial to turn this mode on (in Python2.x the default init deletes the api to do this!)
- The sequence \uXXXX in a byte string constant should turn into the correct UTF-8 sequence. And the sequence \xXX in a Unicode string should be interpreted as bytes and converted from UTF-8 to unicode. This is necessary so that a string constant can easily be changed between bytes and Unicode.
- We must have lossless conversion of UTF-8 to UTF-16. The most popular method I have seen is to turn invalid bytes into 0xd8xx (which is invalid UTF-16 as it is lower-half surrogate pairs). Oddly enough this makes the UTF-16 api useless because the reverse conversion is not lossless, I have looked into this and it may be fixable but is complex: the to-UTF-8 converter must not translate a sequence of these to a legal UTF-8 sequence and instead convert that sequence to the typical 3-byte encoding of that number, and the from-UTF-8 converter must treat these typical 3-byte encodings as invalid byte sequences except when they are arranged such that the back converter would make them! This is messy but I see no other way to be able to use backends that insist on UTF-16 (in particular Windows filenames and it's clipboard).
The reason for this is that real Python programs need to handle arbitrary data that is *PROBABLY* UTF-8. Note that by "PROBABLY" I mean that the programmer really really wants to think of it as a sequence of unicode characters, not as a "byte sequence", but it must NOT compare any two different byte sequences as being equal.
I'm very afraid that Python3.0 as designed will encourage byte sequences to be treated as ISO-8859-1 rather than UTF-8 (because when you set the translation to that it is lossless and no errors are thrown, and \xXX does the same thing in both constants). IMHO this would be very, very bad for internationalization efforts. Believing the programmers will not take this easy solution, and instead rewrite their interfaces to the new byte/unicode naming and correctly handle exceptions thrown by converters is, I think, quite ignorant.
I am not joking or trolling about this. This has bitten me already and forced us to change all our use of Python from Unicode to byte strings. And we are just reading metadata from image files. Searching for comments on Python 3.0 on the web, it is apparent that web programmers are encountering this far more often and are very worried about this, and they certainly are trying to handle many orders of magnitude more data from sources that may be actively trying to exploit security holes.
As a KDE fan, I have to say just how jealous I am that other software development communities actually have common sense.
Apache: "Our newest is Apache 2, but you can use our rock-solid Apache 1 if you want." ... sigh ....
Python: "Our newest is Python 3, but you can use our rock-solid Python 2 if you want."
KDE: "What!? You're still using KDE 3? But we told all our developers to drop all KDE 3 and move on to our newest KDE 4, which just came out with the second release candidate version of the beta for our alpha version! Get with the times, man!"
404555974007725459910684486621289147856453481154 in hex is "You sank my Battleship?"
[GPG key in journal]
Is there a Python clone that uses C style formating?
See http://www.emacswiki.org/emacs-en/PyIndent