Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Point:
- def __init__(self, x, y):
- self.__x=x
- self.__y=y
- dir(Point)
- In [1]: class Point:
- ...: def __init__(self, x, y):
- ...: self.__x=x
- ...: self.__y=y
- ...:
- In [2]: vars(Point)
- Out[2]:
- mappingproxy({'__dict__': <attribute '__dict__' of 'Point' objects>,
- '__doc__': None,
- '__init__': <function __main__.Point.__init__>,
- '__module__': '__main__',
- '__weakref__': <attribute '__weakref__' of 'Point' objects>})
- In [3]: for k, v in vars(Point).items():
- ...: if callable(v):
- ...: print(k)
- ...:
- __init__
- def list_methods(t):
- for item in t.__dict__:
- if isinstance(item, types.FunctiobType):
- print(item)
Add Comment
Please, Sign In to add comment