Last active
December 21, 2019 16:39
-
-
Save FerdinaKusumah/d3ca825ba2e9b9c601e91fb8f755937b to your computer and use it in GitHub Desktop.
Underscore Python
This file contains hidden or 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 Sample(): | |
def __init__(self): | |
self.a = 1 | |
self._b = 2 | |
self.__c = 3 | |
>>> t = Sample() | |
>>> dir(t) | |
['_Sample__c', '__class__', '__delattr__', | |
'__dict__', '__dir__', '__doc__', '__eq__', | |
'__format__', '__ge__', '__getattribute__', | |
'__gt__', '__hash__', '__init__', '__init_subclass__', | |
'__le__', '__lt__', '__module__', '__ne__', | |
'__new__', '__reduce__', '__reduce_ex__', | |
'__repr__', '__setattr__', '__sizeof__', '__str__', | |
'__subclasshook__', '__weakref__', '_b', 'a'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment