45. You don’t need to compare the length with 0
If the length is greater than 0, then it is by default True, so you don’t really need to compare it with 0.
46. You can define the same method multiple times inside the same scope
However, only the last one is called, since it overrides previous ones.
47. You can access private properties even outside their intended scope
48. You can define a method that can be called with as many parameters as you want
49. You can redefine the “+” operator inside your own classes
50. You can also redefine the “<” and “==” operators inside your own classes
Similarly, like the two previous cases, we can override the __eq__() function based on our own needs.
You can also analogously define:
- __sub__() for
- __mul__() for
- __truediv__() for /
- __ne__() for !=
- __ge__() for >=
- __gt__() for >
