[Python-3000-checkins] r58773 - in python/branches/py3k-pep3137/Lib: encodings/idna.py encodings/punycode.py string.py test/string_tests.py test/test_xml_etree.py test/test_xml_etree_c.py

Christian Heimes lists at cheimes.de
Sat Nov 3 22:03:32 CET 2007


Alexandre Vassalotti wrote:
>> Modified: python/branches/py3k-pep3137/Lib/string.py
>> ==============================================================================
>> --- python/branches/py3k-pep3137/Lib/string.py  (original)
>> +++ python/branches/py3k-pep3137/Lib/string.py  Fri Nov  2 16:59:04 2007
>> @@ -53,7 +53,7 @@
>>          raise ValueError("maketrans arguments must have same length")
>>      if not (isinstance(frm, bytes) and isinstance(to, bytes)):
>>          raise TypeError("maketrans arguments must be bytes objects")
>> -    L = bytes(range(256))
>> +    L = buffer(range(256))
>>      for i, c in enumerate(frm):
>>          L[c] = to[i]
>>      return L
>>
> 
> Why string.maketrans() was changed to return a buffer object?

The return type was a PyBytes instance before the grant renaming, too. I
guess you are right. It should return a bytes object.

Christian


More information about the Python-3000-checkins mailing list