Created
April 19, 2020 14:41
-
-
Save mhtocs/97716eab7c0fa4c4425c182115dfc938 to your computer and use it in GitHub Desktop.
To list all callables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
list_callables = lambda module : [ v.__name__ for k,v in module.__dict__.items() if callable(v)] | |
all_math_function = list_callables(math) #list_callables accepts a module name, the module (here math) must be imported already | |
print(all_math_function) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment