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, ∼1882🔥, 0💬
Popular Posts:
What is EPUB 3.0 Metadata "dcterms:modified" property? EPUB 3.0 Metadata "dcterms:modified" is a req...
Where to see some Examples of Invalid JSON Values? Here are some Examples of Invalid JSON Values: 1....
How to access Query String parameters from "context.Request.Url.Que ry"object in Azure API Policy? Q...
How to use the "rewrite-uri" Policy Statement for an Azure API service operation? The "rewrite-uri" ...
How to convert a JSON text string to an XML document with PHP language? Currently, there is no built...