functions in python are objects
func.__code__
and func.__defaults__
func.__code__
was func.func_code
func.__defaults__
was func.func_defaults in python 2
>The default values are stored in func.__defaults__
, and retrieved each time the function is called.
>the body of the function gets compiled and stored in variables under
__code__
>the default arguments get stored in __defaults__
__annotations__
Function annotations are completely optional metadata information about the types used by user-defined functions Return annotations are defined by a literal ->, followed by an expression, between the parameter list and the colon denoting the end of the def statement
__call__
__class__
__closure__
__code__
__defaults__
__delattr__
__dict__
__dir__
__doc__
function documendation string :: short, concise summary of the object’s purpose written between triple quotes at start of function.
__eq__
__format__
__ge__
__get__
__getattribute__
__globals__
__gt__
__hash__
__init__
__init_subclass__
__kwdefaults__
__le__
__lt__
__module__
__name__
__ne__
__new__
__qualname__
__reduce__
__reduce_ex__
__repr__
__setattr__
__sizeof__
__str__
__subclasshook__
Comments
Post a Comment