# HG changeset patch # User Paul Boddie # Date 1481033524 -3600 # Node ID e31fddc66a6c4bd8e3dddec91760acd633ffd854 # Parent a1e90e31b139f9e446fc1a126173e40e2f37e372 Added tests of object naming. diff -r a1e90e31b139 -r e31fddc66a6c tests/name_attribute.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/name_attribute.py Tue Dec 06 15:12:04 2016 +0100 @@ -0,0 +1,16 @@ +import operator + +class C: + pass + +c = C() +print c.__name__ # __main__.C +print C.__name__ # __main__.C + +# If it were defined, operator.__name__ would be __builtins__.core.module. + +print operator.__mname__ + +# If it were defined, operator.add.__name__ would be __builtins__.core.function. + +print operator.add.__fname__