Which more Pythonic - self.__class__ or type(self)?

Thomas Passin list1 at tompassin.net
Thu Mar 2 16:58:57 EST 2023


On 3/2/2023 3:54 PM, Ian Pilcher wrote:
> Seems like an FAQ, and I've found a few things on StackOverflow that
> discuss the technical differences in edge cases, but I haven't found
> anything that talks about which form is considered to be more Pythonic
> in those situations where there's no functional difference.
> 
> Is there any consensus?

For what purpose do you want to get it?



More information about the Python-list mailing list