python里的双下划线函数都是什么意思?
ringa_lee
ringa_lee 2017-04-17 17:37:23
0
4
977
__module__
__new__
__reduce__
__repr__
__reduce_ex__
__getattribute__
ringa_lee
ringa_lee

ringa_lee

reply all(4)
刘奇

Look here

Peter_Zhu

http://rafekettler.com/magicmethods.html

大家讲道理

Hide attributes or methods.

such as

>>> '33'.__hash__()
4038753864587545164
>>> '33'.__len__()==len('33')
True


>>> (3).__pow__(2)
9

>>> int.__pow__(3,2)
9
大家讲道理

Simply put, it’s a hook.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template