Characters contain themselves?

Mark Jackson mjackson at alumni.caltech.edu
Fri Apr 7 10:29:14 EDT 2006


Rene Pijlman <reply.in.the.newsgroup at my.address.is.invalid> writes:
> WENDUM Denis 47.76.11 (agent):
> >While testing recursive algoritms dealing with generic lists I stumbled 
> >on infinite loops which were triggered by the fact that (at least for my 
> >version of Pyton) characters contain themselves.
> 
> No, strings contain characters. And 'a' is a string consisting of one
> character.
> 
> "The items of a string are characters. There is no separate character
> type; a character is represented by a string of one item."
> http://docs.python.org/ref/types.html
> 
> (One item of what type, one might ask)

Good point.  ". . .represented by a string of length one" would be
better.


-- 
Mark Jackson - http://www.alumni.caltech.edu/~mjackson
    An information system based on theory isolated from reality
    is bound to fail.		- Mitch Kabay





More information about the Python-list mailing list