[Python-ideas] duck typing for io write methods

Benjamin Peterson benjamin at python.org
Fri Jun 14 21:56:07 CEST 2013


Wolfgang Maier <wolfgang.maier at ...> writes:

> However, if you decide to inherit from str or int, then bytes() completely
> ignores the __bytes__ method and sticks to the superclass behavior instead,
> i.e. requiring an encoding for str and creating a bytestring of the length
> of an int.

int is fixed in 3.3.





More information about the Python-ideas mailing list