python
[python] (가명) 속성 및 연산자 메쏘드
Нуеоп
2011. 11. 12. 01:22
Class SampleC():
def __init__(self):
pass
sample = SampleC()
>>> dir(sample) # 인스턴스 객체의 속성 + 클래스 객체의 속성
>>> dir(SampleC) # 인스턴스 객체의 속성 + 클래스 객체의 속성 + 슈퍼클래스의 속성
>>> dir([])
>>> dir({})
>>> dir((,))
__repr__
__str__
__add__
__getitem__
__getattr__
__len__
__doc__
__name__
__dict__
__new__
__hash__
__delattr__
__setattr__
__class__
__name__
__call__
__nonzero__
__cmp__
__lt__
__le__
__gt__
__ge__
__eq__
__ne__
__delitem__
__contains__
__iter__
__add__
__sub__
__mul__
__div__
__truediv__
__floordiv__
__mod__
__divmod__
__pow__
__lshift__
__rshift__
__and__
__xor__
__or__
__radd__
__rsub__
__rdiv__
__rmul__
...
__iadd__
__isub__
__imul__
__idiv__
__itruediv__
__ifloordiv__
__imod__
__ipow__
__ilshift__
__irshift__
__iand__
__ixor__
__ior__
__neg__
__pos__
__abs__
__invert__
__complex__
__int__
__long__
__float__
__oct__
__hex__
Data model (Attribute)
http://docs.python.org/reference/datamodel.html
Built-in Functions
http://docs.python.org/library/functions.html
Built-in Types
http://docs.python.org/library/stdtypes.html
def __init__(self):
pass
sample = SampleC()
>>> dir(sample) # 인스턴스 객체의 속성 + 클래스 객체의 속성
>>> dir(SampleC) # 인스턴스 객체의 속성 + 클래스 객체의 속성 + 슈퍼클래스의 속성
>>> dir([])
>>> dir({})
>>> dir((,))
__repr__
__str__
__add__
__getitem__
__getattr__
__len__
__doc__
__name__
__dict__
__new__
__hash__
__delattr__
__setattr__
__class__
__name__
__call__
__nonzero__
__cmp__
__lt__
__le__
__gt__
__ge__
__eq__
__ne__
__delitem__
__contains__
__iter__
__add__
__sub__
__mul__
__div__
__truediv__
__floordiv__
__mod__
__divmod__
__pow__
__lshift__
__rshift__
__and__
__xor__
__or__
__radd__
__rsub__
__rdiv__
__rmul__
...
__iadd__
__isub__
__imul__
__idiv__
__itruediv__
__ifloordiv__
__imod__
__ipow__
__ilshift__
__irshift__
__iand__
__ixor__
__ior__
__neg__
__pos__
__abs__
__invert__
__complex__
__int__
__long__
__float__
__oct__
__hex__
Data model (Attribute)
http://docs.python.org/reference/datamodel.html
Built-in Functions
http://docs.python.org/library/functions.html
Built-in Types
http://docs.python.org/library/stdtypes.html