On Sat, Jan 31, 2009 at 5:57 PM, Tim Johnson <t...@johnsons-web.com> wrote:
> Using python 2.5.1
>
> If I create a class a
>
> class a:
>
> pass
>
> initialize o as:
>
> o=a
>
> and call
>
> isinstance(o,a)
>
> the return value is True.

Actually, it is false. To make it true, you have to do o=a() rather than o=a

> Is there a function that takes one
>
> argument and returns the class?
>
> Example:
>
> class = whatclass(o)
>
>>> "a"
>
> Since I'm hoping the answer to this question will help me
>
> answer some bigger questions, pointers to relevant docs
>
> and discussions is invited.

o.__class__ (or rather o.__class__.__name__) will work.



--
André Engels, andreeng...@gmail.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to