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, 1265👍, 0💬
Popular Posts:
How To Control Padding Spaces within a Table Cell? Cell padding spaces are spaces between cell inner...
What is Azure API Management Gateway? Azure API Management Gateway is the Azure Web server that serv...
What is EPUB 2.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 2.0 Metadata "dc:publisher" ...
How To Control Padding Spaces within a Table Cell? Cell padding spaces are spaces between cell inner...
How to access Query String parameters from "context.Request.Url.Que ry"object in Azure API Policy? Q...