Thank you, type(o) is sufficient.
It is possible to use class properties:

type(o).__name__
'c'

On Wed, Mar 03, 2021 at 10:03:03PM +0000, Paul Bryan wrote:
Since class is a keyword, this is unlikely. Why is type(o)
insufficient?

On Wed, 2021-03-03 at 22:59 +0100, Hans Ginzel wrote:
>>> class c: pass
>>> o = c()
>>> o.__class__
<class '__main__.c'>
>>> class(o)
    File "<stdin>", line 1
      class(o)
           ^
SyntaxError: invalid syntax

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/X6FJM5IBF6XBIIZM5CVISCWLND5ESXHD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to