Python 3.x uses __truediv__
and __floordiv__
. __div__
is 2.x-only.
More Related Contents:
- Overloading Addition, Subtraction, and Multiplication Operators
- Does Python have a ternary conditional operator?
- how to unpack a tuple in this form (‘abc’, [20, 20])? [closed]
- What is the result of % in Python?
- How do I call a parent class’s method from a child class in Python?
- Instance variables vs. class variables in Python
- Python: Bind an Unbound Method?
- Why do we use __init__ in Python classes?
- Why can tuples contain mutable items?
- What does the percentage sign mean in Python
- Python decorators in classes
- Why does a class’ body get executed at definition time?
- Python convert tuple to string
- Private members in Python
- Overriding “+=” in Python? (__iadd__() method)
- Why is exponentiation applied right to left?
- Accessing a value in a tuple that is in a list
- How to convert a list to a list of tuples?
- Prevent creating new attributes outside __init__
- Is there a way to instantiate a class without calling __init__?
- Sorting a tuple that contains tuples
- In class object, how to auto update attributes?
- JSON serialize a dictionary with tuples as key
- Does Python have an immutable list?
- How to extend a class in python?
- Using Python class as a data container [closed]
- Python calling method in class
- How to find instance of a bound method in Python?
- In what case would I use a tuple as a dictionary key? [closed]
- Under what circumstances are __rmul__ called?