I\'m developing a bot on Python (2.7, 3.4). I defined a about 30+ dynamic functions which to be used based on bot commands. While development, since not all functions are done,
Yes, it's perfectly possible since defined functions are stored in variables like everything else.
def foo():
pass
baz = bar = foo
There is still some metadata relating to the original function (help(bar)
will still mention foo
), but it doesn't affect functionality.
Another option is to use lambda
s for one-liners:
foo = bar = baz = lambda: None