[Python-3000] tp_bytes and __bytes__ magic method

Victor Stinner victor.stinner at haypocalc.com
Thu Aug 9 01:13:35 CEST 2007


On Thursday 09 August 2007 00:54:47 Guido van Rossum wrote:
> On 8/8/07, Christian Heimes <lists at cheimes.de> wrote:
> > Victor Stinner just made a good point at #python. The py3k has no magic
> > method and type slot for bytes (...)
> > I can think of a bunch of use cases for a magic method.
>
> Such as?

I'm writting on email module and I guess that some __str__ methods should 
return bytes instead of str (and so should be renamed to __bytes__). Maybe 
the one of Message class (Lib/email/message.py).

Victor Stinner aka haypo
http://hachoir.org/


More information about the Python-3000 mailing list