Monkey-patching a Python instance method

Dynamically adding or overwriting an instance method in Python is rarely needed, but it’s a good excuse to explore interesting aspects of the language that aren’t always well known: the descriptor protocol, types.MethodType and partial function applicatio…

Similar

Python – Operator Overloading

With operator overloading feature in Python, we can make operators to work for user defined classes. As we create a class, it creates a new type in the code and Python allows us to specify the operators with a special meaning for a data type, this ability... (more…)

Read more »

From Python to Numpy

There are already a fair number of books about Numpy (see Bibliography) and a legitimate question is to wonder if another book is really necessary. As you may have guessed by reading these lines, my personal answer is yes, mostly because I think there is ...

Read more »