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

Is There A Way To Run A Method Automatically On The Initialization Of An Instance Without Using __init__?

I am writing some unit tests with Pytest. If I want them to be collected automatically, I have to … Read more Is There A Way To Run A Method Automatically On The Initialization Of An Instance Without Using __init__?

Why Doesn't The Namedtuple Module Use A Metaclass To Create Nt Class Objects?

I spent some time investigating the collections.namedtuple module a few weeks ago. The module uses … Read more Why Doesn't The Namedtuple Module Use A Metaclass To Create Nt Class Objects?

Weird Inheritance With Metaclasses

I'm experiencing some really weird problems in Python when trying to inherit from a class with … Read more Weird Inheritance With Metaclasses

Python Class Inherited Singleton Inits Instance On Every Call

I'm trying to implement class inherited singleton as described here (Method 2). Going over the … Read more Python Class Inherited Singleton Inits Instance On Every Call