Re: class(obj) could return obj.__class__

March 3, 2021
10:03 p.m.
Err, why is it insufficient? On Wed, 2021-03-03 at 14:03 -0800, Paul Bryan wrote:
Since class is a keyword, this is unlikely. Why is type(o) not 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
1532
Age (days ago)
1532
Last active (days ago)
0 comments
1 participants
participants (1)
-
Paul Bryan