python 運算符 供重載參考
更新時間:2009年06月11日 22:33:02 作者:
二元運算符及其對應(yīng)的特殊方法
| 二元運算符 | 特殊方法 |
| + | __add__,__radd__ |
| - | __sub__,__rsub__ |
| * | __mul__,__rmul__ |
| / | __div__,__rdiv__,__truediv__,__rtruediv__ |
| // | __floordiv__,__rfloordiv__ |
| % | __mod__,__rmod__ |
| ** | __pow__,__rpow__ |
| << | __lshift__,__rlshift__ |
| >> | __rshift__,__rrshift__ |
| & | __and__,__rand__ |
| ^ | __xor__,__rxor__ |
| | | __or__,__ror__ |
| += | __iaddr__ |
| -= | __isub__ |
| *= | __imul__ |
| /= | __idiv__,__itruediv__ |
| //= | __ifloordiv__ |
| %= | __imod__ |
| **= | __ipow__ |
| <<= | __ilshift__ |
| >>= | __irshift__ |
| &= | __iand__ |
| ^= | __ixor__ |
| |= | __ior__ |
| == | __eq__ |
| !=,<> | __ne__ |
| > | __get__ |
| < | __lt__ |
| >= | __ge__ |
| <= | __le__ |
相關(guān)文章
使用Python3內(nèi)置文檔高效學(xué)習(xí)以及官方中文文檔
這篇文章主要給大家介紹了關(guān)于使用Python3內(nèi)置文檔高效學(xué)習(xí)以及官方中文文檔的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用Python3具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-05-05
Python中parsel兩種獲取數(shù)據(jù)方式小結(jié)
本文主要介紹了Python中parsel兩種獲取數(shù)據(jù)方式小結(jié),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-04-04
使用Python開發(fā)Excel表格數(shù)據(jù)對比工具
這篇文章主要為大家詳細(xì)介紹了如何通過 Python 和 PyQt5 結(jié)合 pandas 庫,快速實現(xiàn)一個高效、自動化的 Excel 數(shù)據(jù)對比工具,感興趣的小伙伴可以了解下2025-03-03

