__call__ function

The role of call () is to enable the instance to be called like a function without affecting the life cycle of the instance itself ( call () does not affect the construction and destruction of an instance). But __call__() can be used to change the value of an instance's internal members.
Instance name (), which is to call the __call__() method.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325065230&siteId=291194637