Re: Objects with __name__ attribute

2017-11-01 Thread dieter
"ast" writes: > I know two Python's objects which have an intrinsic name, classes and > functions. > ... > Are there others objects with a __name__ attribute > and what is it used for ? Some Python objects naturally have a name: functions, classes, modules, ...; others don't: tuples, lists, integ

Re: Objects with __name__ attribute

2017-10-25 Thread Peter Otten
ast wrote: > Hi, > > I know two Python's objects which have an intrinsic > name, classes and functions. > > def f(): > pass > f.__name__ > 'f' g = f g.__name__ > 'f' > > class Test: > pass > Test.__name__ > 'Test' Test2 = Test Test2.__name__ > 'Test' > >

Objects with __name__ attribute

2017-10-24 Thread ast
Hi, I know two Python's objects which have an intrinsic name, classes and functions. def f(): pass f.__name__ 'f' g = f g.__name__ 'f' class Test: pass Test.__name__ 'Test' Test2 = Test Test2.__name__ 'Test' Are there others objects with a __name__ attribute and what is it us