Python3 - encoding issues

DreiJane joost at h-labahn.de
Sat Nov 28 22:09:20 EST 2009


Ohhh - that's nice. But no words of that in the library reference
here:

http://docs.python.org/3.1/library/stdtypes.html#sequence-types-str-bytes-bytearray-list-tuple-range

Still this fails:

>>> a = (1,2,3,4)
>>> print(a.startswith((1,2)))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'startswith'

Still methods of this kind would have a better place in the sequence
protocol.



More information about the Python-list mailing list