Operator Overloading

Learn to overload an operator in Python.

Python permits operator overloading but within certain constraints:

  • Overloading the operators for built-in types is not allowed.
  • Creating new operators is not allowed.
  • Few operators can’t be overloaded, e.g., is, and, or and not.
svg viewer

Get hands-on with 1400+ tech skills courses.