Tools, FAQ, Tutorials:
Pass Function as Function Parameter
How to pass function objects as function parameters?
✍: FYIcenter.com
You can pass function objects like any other types of objects as parameters of other functions.
For example,
>>> def x():
... print("Hello world!")
...
>>> def addVersion(f):
... f.version = "1.0"
... f.author = "FYIcenter.com"
... return f
...
>>> y = addVersion(x)
>>> x.version
'1.0'
>>> y.version
'1.0'
⇐ '__dict__' Dictionary in Function Object
2018-02-08, ∼1945🔥, 0💬
Popular Posts:
dev.FYIcenter.com is a Website for software developer looking for software development technologies,...
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
How to run CMD Commands in Dockerfile to change Windows Docker images? When building a new Windows i...
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...