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, ∼1908🔥, 0💬
Popular Posts:
How to install "The Windows SDK version 8.1"? I need to build my Visual Studio C++ applications. If ...
Where to find tutorials on Python programming language? I want to learn Python. Here is a large coll...
How To Protect Special Characters in Query String in PHP? If you want to include special characters ...
How to build a test service operation to dump everything from the "context.Request" object in the re...
How to use "link" command tool to link objet files? If you have object files previously compiled by ...