Last active
January 21, 2019 14:16
-
-
Save TimurNurlygayanov/43cb8e44b45bc7dd7e5bdfc1ce470565 to your computer and use it in GitHub Desktop.
parent_and_child_python
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
class a(object): | |
my_attr = 'simple attribute' | |
_my_attr2 = 'internal attribute' | |
__my_attr3 = 'real internal attribute' | |
# Magic here: ['_a__my_attr3', '_my_attr2', 'my_attr'] | |
print([name for name in dir(a) if 'my_attr' in name]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment