Please use type(o) instead.

On Tue, Feb 9, 2021 at 4:36 PM Hans Ginzel <[email protected]> wrote:
>
> Please, consider class(obj) to return obj.__class__
> consistenly with dir(), vars(), repr(), str(),…
>
> >>> class c: pass
> >>> o = c()
> >>> o.__class__
> <class '__main__.c'>
> >>> class(o)
>    File "<stdin>", line 1
>      class(o)
>           ^
> SyntaxError: invalid syntax
>
> H.
> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at 
> https://mail.python.org/archives/list/[email protected]/message/TMFUKID6KMTEAZAS4ILBHSG23GGYNCS4/
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
Inada Naoki  <[email protected]>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/LMNS3XTBSIOGLNFFSG7P2MEVO3TWVIN5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to