>>> class Test(object): pass >>> t = Test() >>> type(t) is t.__class__ True >>> type(t) __main__.Test
So these two are the same. I would use self.__class__ , as it is more obvious what it is.
However, type(t) will not work for old-style classes, since the instance type of the old-style class is instance , and the instance type of the new-style class is its class:
>>> class Test(): pass >>> t = Test() >>> type(t) is t.__class__ False >>> type(t) instance
ThiefMaster Apr 30 2018-12-12T00: 00Z
source share