Benjamin Peterson added the comment:
I changed the precedence now, so __bytes__ is tried before __index__.
--
nosy: +benjamin.peterson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15559
___
New submission from Nick Coghlan:
I've been tinkering with the ipaddress module as I review Eli's documentation
and have uncovered a *very* nasty interaction between ipaddress objects and the
bytes constructor.
Specifically, if you pass an integer to bytes() it will attempt to allocate and
Roundup Robot added the comment:
New changeset 5abea8a43f19 by Nick Coghlan in branch 'default':
Close #15559: Implementing __index__ creates a nasty interaction with the bytes
constructor. At least for 3.3, ipaddress objects must now be explicitly
converted with int() and thus can't be passed