Skip to content

Instantly share code, notes, and snippets.

@ustropo
Created August 12, 2022 13:59
Show Gist options
  • Save ustropo/a4fcea7d74e8a9dab356cd27eaeffeb2 to your computer and use it in GitHub Desktop.
Save ustropo/a4fcea7d74e8a9dab356cd27eaeffeb2 to your computer and use it in GitHub Desktop.
>>> def add_one(x):
... return x + 1
...
>>> dir(add_one)
['__annotations__', '__builtins__', '__call__', '__class__', '__closure__', '__code__',
'__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__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__']
>>> add_one.__name__
'add_one'
>>> add_one.__class__
<class 'function'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment