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, 1566🔥, 0💬
Popular Posts:
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
How to use the "find-and-replace" Policy Statement for an Azure API service operation? The "find-and...
How to read RSS validation errors at w3.org? If your RSS feed has errors, the RSS validator at w3.or...
How to make application release build with Visual Studio 2017? If you want to make a final release b...
What is the "__init__()" class method? The "__init__()" class method is a special method that will b...