Skip to content Skip to sidebar Skip to footer
Showing posts with the label Subclass

Python: Dynamically Adding Attributes To A Built-in Class

Why doesn't it work for the built-in classes? Is using a subclass the best approach to fix it, … Read more Python: Dynamically Adding Attributes To A Built-in Class

I Want To Subclass Dict And Set Default Values

I have a need to create a special subclass of dict. In it I want to set default values for a set o… Read more I Want To Subclass Dict And Set Default Values

Why Is My Superclass Calling My Subclass Method?

When I call a method that was overrided from my constructor, I am getting an error and it says that… Read more Why Is My Superclass Calling My Subclass Method?

Subclassing Dict: Should Dict.__init__() Be Called?

Here is a twofold question, with a theoretical part, and a practical one: When subclassing dict: cl… Read more Subclassing Dict: Should Dict.__init__() Be Called?

Some Numpy Functions Return Ndarray Instead Of My Subclass

I am subclassing Numpy's ndarray class, adding some meta-data and additional methods. I'm … Read more Some Numpy Functions Return Ndarray Instead Of My Subclass