Differences between revisions 5 and 6
Revision 5 as of 2005-09-11 08:31:59
Size: 1174
Editor: FredDrake
Comment: copyedit
Revision 6 as of 2006-03-01 20:51:56
Size: 1166
Editor: outgw
Comment: switch to more recent bytes PEP
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
 [[Anchor(b)]][1] [http://python.org/peps/pep-0296.html PEP 296 -- Adding a bytes Object Type]  [[Anchor(b)]][1] [http://python.org/peps/pep-0356.html PEP 356 -- The "bytes" Object]

The str type is not a string of characters

Python was started by Guido van Rossum in December of 1989, Unicode was started in 1991. It is hard to expect that Python developers could introduce Unicode strings since early versions. Trying to "reinvent" Unicode was not an option either since Unicode is a really huge work. Python developers simply introduced strings as they existed in C and many other languages of that time. In the C language a string is a sequence of bytes, and so is Python str type.

There is no consensus how to call these strings now, in the age of Unicode. Some people call them byte strings, some call them generic strings, and others call them 8-bit strings, but what is more confusing for a unicode newbie is that a lot of people simply call them strings most of the time. If you want to understand python unicode you have to understand the difference between byte strings and unicode strings. ["Python3.0"] will clear up this confusion by getting rid of byte strings and introducing the new type bytes. #b 1

References

StrIsNotAString (last edited 2008-11-15 13:59:46 by localhost)

Unable to edit the page? See the FrontPage for instructions.