Python 3 __bytes__ method

Ethan Furman ethan at stoneleaf.us
Sat Jan 11 19:24:46 EST 2014


Python 3 has a new method, __bytes__.  The docs say: Called by bytes() to compute a byte-string representation of an 
object. This should return a bytes object.

I must admit I'm not entirely clear how this should be used.  Is anyone using this now?  If so, how?

--
~Ethan~



More information about the Python-list mailing list