How to use a callback function in python?

后端 未结 2 628
谎友^
谎友^ 2021-01-17 10:09

I wonder how to correctly use python 2.7 callback functions.

I have some callback functions from Cherrypy auth examples in my code.

(These callbacks return

2条回答
  •  耶瑟儿~
    2021-01-17 10:09

    If you execute it, it is plain simple.

    member_of() will return method object check. you have to execute to get result by doing something like if member_of('admin')(): or,

    k=member_of('admin')
    if k():
    

    To do your task.

提交回复
热议问题