Tools, FAQ, Tutorials:
'__dict__' Dictionary in Function Object
What is the "__dict__" dictionary property in a function object?
✍: FYIcenter.com
By default every function object has "__dict__" built-in dictionary property.
Each name value pair in this dictionary becomes a formal property of the
function object accessible using the "." operation.
It is empty when the function object is created. But you can add name value pairs to the "__dict__" dictionary.
For example, the following Python code shows how to use the "__dict__" dictionary of function object:
>>> def x():
... print("Hello world!")
...
>>> x.version = "1.0"
>>> x.__dict__["author"] = "FYIcenter.com"
>>> x.__dict__
{'version': '1.0', 'author': 'FYIcenter.com'}
>>> x.version
'1.0'
>>> x.author
'FYIcenter.com'
⇒ Pass Function as Function Parameter
2018-02-08, ∼2426🔥, 0💬
Popular Posts:
How to use "xml-to-json" Azure API Policy Statement? The "xml-to-json" Policy Statement allows you t...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
How to convert a JSON text string to an XML document with PHP language? Currently, there is no built...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
How to create a new API on the Publisher Dashboard of an Azure API Management Service? If you are ne...