[Python-3000] PEP 3137 plan of attack
Christian Heimes
lists at cheimes.de
Wed Oct 10 23:31:35 CEST 2007
Guido van Rossum wrote:
>>>>> b"abc".count("b")
>> >> 1
> >
> > This is a bug.
> >
>>>>> "abc".count(b"b")
>> >> 1
> >
> > This too.
> >
>>>> >>>> buffer(b"abc").count("b")
>> >> Traceback (most recent call last):
>> >> File "<stdin>", line 1, in <module>
>> >> SystemError: can't use str as char buffer
> >
> > What is buffer? Are you using an old version of the tree (where it was
> > an object like memoryview) or a patched version where you've already
> > renamed str8 to buffer?
It was a test in my patched version of Python with the new names (str8
-> bytes, bytes -> buffer).
> > The rename is trivial. It's fixing all the unit tests that matters.
Yes, I know what you are talking about. *g* The unit tests aren't easy
to fix. It will take some time. Right now even the interpreter isn't
running with the new names.
>>>>> >>>>> b''
>> >> b''
>>>>> >>>>> type(b'')
>> >> <type 'bytes'>
>>>>> >>>>> type(b'') is str8
>> >> True
>>>>> >>>>> type(b'') is bytes
>> >> True
>>>>> >>>>> type(buffer(b''))
>> >> <type 'buffer'>
>> >>
>> >> I'll keep working on the patch.
> >
> > Cool.
That was another interpreter session with my rename patch. I've another
patch that removes basestring from Python 3.0:
http://bugs.python.org/issue1258
Christian
More information about the Python-3000
mailing list