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, 1090👍, 0💬
Popular Posts:
How to create Hello-2.0.epub with WinRAR? I have all required files to create Hello-2.0.epub. To cre...
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...
How to create a navigation file like navigation.xhtml for an EPUB 3.0 book? At least one navigation ...
Where to find tutorials on Visual Studio? I want to know How to learn Visual Studio. Here is a large...
How to create a navigation file like navigation.xhtml for an EPUB 3.0 book? At least one navigation ...