2009/2/6 Ken Elkabany :
>
> 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 ?
If it's enough to change how the type looks like you can simply
Ken Elkabany wrote:
Hello,
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 'int'>? Or for that matter, any other primitive? I do not care how
Ken Elkabany schrieb:
> I would simply subclass 'int', but this object needs to be general enough to
> pretend to be an 'int', 'NoneType', 'str', etc... A long shot: Can I change
> the base class on an instance by instance basis depending on the need? Well,
> now I can imagine having a class factor
I would simply subclass 'int', but this object needs to be general enough to
pretend to be an 'int', 'NoneType', 'str', etc... A long shot: Can I change
the base class on an instance by instance basis depending on the need? Well,
now I can imagine having a class factory that will spawn for me the c
On Fri, Feb 6, 2009 at 3:03 AM, Ken Elkabany wrote:
> Hello,
>
> 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 ? Or for that
> matter, any
Hello,
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 ? Or for that
matter, any other primitive? I do not care how dirty the solution might
poss