Created
December 11, 2016 15:54
-
-
Save belsander/0a7bfcf785964e2683d70250f2812bd3 to your computer and use it in GitHub Desktop.
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
dir([object]) | |
# Example | |
class test_class: | |
def __init__(self, test_property): | |
self.__test_property = test_property; | |
@property | |
def test_property(self): | |
return self.__property_value | |
@test_property.setter | |
def test_property(self, value): | |
self.__test_property = value; | |
def test_function(self): | |
print("Test Function") | |
class test_inner_class: | |
def __init__(self): | |
print("I'm empty") | |
>>> dir(test_class) | |
['__doc__', '__init__', '__module__', 'test_function', 'test_inner_class', 'test_property'] | |
# '__doc__', '__init__' and '__module__' are always present in a class | |
# __doc__: string which is used for documentation | |
# __init__: constructor of the class | |
# __module__: name of the module the class was defined in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment