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

How to Test Complex Data in Python

In this tutorial, we'll learn how to test complex data structures in Python. Examples of such data include images, nested dictionaries, dictionaries of numpy arrays and even file contents. Learning how to test complex data is a very helpful skill, es... (more…)

Read more »