Dec-18-2018, 04:33 PM
I would suggest you read Data Model | Special method names section from the docs
__getattribute__()
Emulating container types
Note that opposite to __setitem__() is __getitem__()
__getattribute__()
>>> foo = {'foo':1, 'bar':2} >>> foo.__getattribute__('keys') <built-in method keys of dict object at 0x7fe05ce3fb88>As you can see it returns the built-in method
dict.keys()
Emulating container types
Note that opposite to __setitem__() is __getitem__()
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs