Skip to content

Instantly share code, notes, and snippets.

@rafal-jaworski
Created October 13, 2017 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafal-jaworski/cfa2393a6c7f2d5b251c4db9660914ae to your computer and use it in GitHub Desktop.
Save rafal-jaworski/cfa2393a6c7f2d5b251c4db9660914ae to your computer and use it in GitHub Desktop.
In [1]: class C():
...: def __x(self):
...: return 0
...:
In [2]: c = C()
In [3]: dir(c)
Out[3]:
['_C__x',
'__class__',
'__delattr__',
'__dict__',
'__dir__',
'__doc__',
'__eq__',
'__format__',
'__ge__',
'__getattribute__',
'__gt__',
'__hash__',
'__init__',
'__le__',
'__lt__',
'__module__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'__weakref__']
In [4]: c._C__x()
Out[4]: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment