2009/2/6 Ken Elkabany <k...@elkabany.com>: > > I am attempting to fully-simulate an 'int' object with a custom object type. > It is part of a library I am creating for python futures and promises. Is > there anyway such that type(my_object) can return <type 'int'>?
If it's enough to change how the type looks like you can simply change its repr: >>> class X(type): ... def __repr__(self): ... return 'xxx' ... >>> class Y(object): ... __metaclass__ = X ... >>> type(Y()) xxx Cheers, .peke -- http://mail.python.org/mailman/listinfo/python-list