Does Python have a naming convention for variables that are functions?
No, it’s not, functions are first class objects in Python. Pass the name of the function as you will gain access to it for calling.
For instance:
def foo():
pass
foo()
another_function(foo)
- . , , , , . :
def do_nothing():
pass
EDIT: , _fn , :
def foo_a():
print 'a'
def foo_b():
print 'b'
funcs = {'a': foo_a, 'b': foo_b}
key = 'a'
foo_fn = funcs[key]
foo_fn()
another_function(foo_fn)