Skip to content Skip to sidebar Skip to footer
Showing posts with the label Operator Overloading

Why Can't I Add A Tuple To A List With The '+' Operator In Python?

Python not support adding a tuple to a list: >>> [1,2,3] + (4,5,6) Traceback (most recent … Read more Why Can't I Add A Tuple To A List With The '+' Operator In Python?

Can You Impose Object Precedence For Overloaded Operators In Python?

Say I have two Python classes which both define the add and radd operator overloads, and I add one … Read more Can You Impose Object Precedence For Overloaded Operators In Python?

Django : Case Insensitive Matching Of Username From Auth User?

Django by-default implements username as case sensitive, now for authentication I have written my o… Read more Django : Case Insensitive Matching Of Username From Auth User?

How To Overload `float()` For A Custom Class In Python?

Summary How can I overload the built-in float for my class so when I call float() on an instance of… Read more How To Overload `float()` For A Custom Class In Python?