[Python-Dev] [Python-checkins] r64424 - in python/trunk: Include/object.h Lib/test/test_sys.py Misc/NEWS Objects/intobject.c Objects/longobject.c Objects/typeobject.c Python/bltinmodule.c

Eric Smith eric+python-dev at trueblade.com
Fri Jun 20 23:17:23 CEST 2008

I thought there was a discussion of this earlier, and the idea was to 
leave the prior implementation, because that's how it's implemented in 
3.0.  bin() is a new feature in 2.6, so there's no particular need to 
make it work like hex() and oct().

Recall that in 3.0, __bin__, __oct__, and __hex__ don't exist.  Instead, 
you use __index__ for integer conversions.  That's how bin() worked in 
2.6 until this checkin.

But now that I look for it, I can't find the original discussion.

raymond.hettinger wrote:
> Author: raymond.hettinger
> Date: Fri Jun 20 06:18:15 2008
> New Revision: 64424
> Log:
> Make bin() implementation parallel oct() and hex() so that int/long subclasses can override or so that other classes can support.

More information about the Python-Dev mailing list