Skip to content

Commit 01770fb

Browse files
Update mazic_method.md
1 parent 5e84cf4 commit 01770fb

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

OOPS/mazic_method.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,85 @@
22
Binary Operators
33
Operator Method
44
+ object.__add__(self, other)
5+
56
- object.__sub__(self, other)
7+
68
* object.__mul__(self, other)
9+
710
// object.__floordiv__(self, other)
11+
812
/ object.__truediv__(self, other)
913
% object.__mod__(self, other)
14+
1015
** object.__pow__(self, other[, modulo])
16+
1117
<< object.__lshift__(self, other)
18+
1219
>> object.__rshift__(self, other)
20+
1321
& object.__and__(self, other)
22+
1423
^ object.__xor__(self, other)
24+
1525
| object.__or__(self, other)
26+
1627
Extended Assignments
1728
Operator Method
1829
+= object.__iadd__(self, other)
30+
1931
-= object.__isub__(self, other)
32+
2033
*= object.__imul__(self, other)
34+
2135
/= object.__idiv__(self, other)
36+
2237
//= object.__ifloordiv__(self, other)
2338
%= object.__imod__(self, other)
39+
2440
**= object.__ipow__(self, other[, modulo])
41+
2542
<<= object.__ilshift__(self, other)
43+
2644
>>= object.__irshift__(self, other)
45+
2746
&= object.__iand__(self, other)
47+
2848
^= object.__ixor__(self, other)
49+
2950
|= object.__ior__(self, other)
51+
3052
Unary Operators
3153
Operator Method
3254
- object.__neg__(self)
55+
3356
+ object.__pos__(self)
57+
3458
abs() object.__abs__(self)
59+
3560
~ object.__invert__(self)
61+
3662
complex() object.__complex__(self)
63+
3764
int() object.__int__(self)
65+
3866
long() object.__long__(self)
67+
3968
float() object.__float__(self)
69+
4070
oct() object.__oct__(self)
71+
4172
hex() object.__hex__(self
73+
4274
Comparison Operators
4375
Operator Method
4476
< object.__lt__(self, other)
77+
4578
<= object.__le__(self, other)
79+
4680
== object.__eq__(self, other)
81+
4782
!= object.__ne__(self, other)
83+
4884
>= object.__ge__(self, other)
85+
4986
> object.__gt__(self, other)

0 commit comments

Comments
 (0)