Hard to believe (was Re: [Python-Dev] New Features in Python 1.6)
Peter Funk
pf@artcom-gmbh.de
Sun, 2 Apr 2000 14:49:26 +0200 (MEST)
Hi!
Guido van Rossum on april 1st:
[...]
> With the recent release of Python 1.6 alpha 1, a lot of people have
> been wondering what's new. This short note aims to explain the major
> changes in Python 1.6.
[...]
> Python strings can now be stored as Unicode strings. To make it easier
> to type Unicode strings, the single-quote character defaults to creating
-------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> a Unicode string, while the double-quote character defaults to ASCII
----^^^^^^^^^^^^^^
> strings.
As I read this my first thoughts were:
"Huh? Is that really true? To me this sounds like a april fools joke.
But to be careful I checked first before I read on:
pf@artcom0:ttyp4 ~/archiv/freeware/python/CVS_01_04_00/dist/src 41> ./python
Python 1.6a1 (#2, Apr 1 2000, 19:19:18) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> 'a'
'a'
>>> 'ä'
'\344'
>>> u'ä'
u'\344'
Since www.python.org happens to be down at that moment, I was unable to check,
whether my CVS tarball I downloaded from Davids starship account
was recent enough and whether this single-quote-defaults-to-unicode
has been discussed earlier before I got subscribed to python-dev. Better
I should have read on first, before starting to wonder...
[...]
> tokens = "foo bar baz".split(" ")
> Or, equivalently, this:
> tokens = " ".split("foo bar baz")
>
> (Python figures out which string is the delimiter and which is the
> string to split by examining both strings to see which one occurs more
> frequently inside the other.)
Now it becomes clearer that this *must* be an april fools joke! ;-) :
>>> tokens = "foo bar baz".split(" ")
>>> print tokens
['foo', 'bar', 'baz']
>>> tokens = " ".split("foo bar baz")
>>> print tokens
[' ']
[...]
> Note that use of any string method on a particular string renders it
> mutable.
[...]
> For consistency with C and C++,
> asterisks in the function signature become ampersands in the function
> body:
[...]
> load modules via HTTP from a known URL.
[...]
> This has allowed us to drop most of the standard library from the
> distribution...
[...]
Pheeew... Oh Well. And pigs can fly. Sigh! ;-)
That was a well prepared April fools joke!
Regards, Peter
--
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)