In Python 2.6 (and earlier) the hex() and oct() built-in functions can be overloaded in a class by defining __hex__ and __oct__
hex()
oct()
__hex__
__oct__
The bin function receives it's value from the object's __index__ function. So for an object, you can define the value converted to binary, but you can't define the format of the string.
__index__