Accessing parent objects

D'Arcy Cain darcy at VybeNetworks.com
Sun Mar 25 07:07:55 EDT 2018


On 03/25/2018 05:10 AM, Jugurtha Hadjar wrote:
>         print("I am {self.__class__.__name__} foo".format(self=self))

Unrelated to the original issue but why not one of the following?

print("I am {0.__class__.__name__} foo".format(self))
print(f"I am {self.__class__.__name__} foo")

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:darcy at Vex.Net VoIP: sip:darcy at VybeNetworks.com



More information about the Python-list mailing list