Created
April 27, 2021 14:25
-
-
Save DarinMao/ed4a1590da0740583b13d58c5f30c8fd to your computer and use it in GitHub Desktop.
function to get code object constructor arguments from a function
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
def code_args(func): | |
return ( | |
func.__code__.co_argcount, | |
func.__code__.co_posonlyargcount, | |
func.__code__.co_kwonlyargcount, | |
func.__code__.co_nlocals, | |
func.__code__.co_stacksize, | |
func.__code__.co_flags, | |
func.__code__.co_code, | |
func.__code__.co_consts, | |
func.__code__.co_names, | |
func.__code__.co_varnames, | |
func.__code__.co_filename, | |
func.__code__.co_name, | |
func.__code__.co_firstlineno, | |
func.__code__.co_lnotab, | |
func.__code__.co_freevars, | |
func.__code__.co_cellvars, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment