Bug or feature?

Rikard Bosnjakovic rikbo716 at student.liu.se
Wed Mar 21 07:39:30 EST 2001


Markus Reitz wrote:

> I expected a TypeError message, because a String is not a list and so it
> can't be used to extend an existing list.

No, but a String is a sequence.  Try [].extend(4711) and you will get
the following error:

TypeError: list.extend() argument must be a sequence

And a sequence could be parsed like what you wrote, "a list of
characters".


-- 
Rikard Bosnjakovic - http://a214.ryd.student.liu.se/cv/ - ICQ: 1158217

Anyone sending unwanted advertising e-mail to my address will be
charged $250 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.



More information about the Python-list mailing list