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

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

Is It Possible To Dynamically Create A Metaclass For A Class With Several Bases, In Python 3?

In Python 2, with a trick it is possible to create a class with several bases, although the bases h… Read more Is It Possible To Dynamically Create A Metaclass For A Class With Several Bases, In Python 3?

Arguments Of __new__ And __init__ For Metaclasses

I am a bit surprised by the method call order and the different arguments when overriding new and i… Read more Arguments Of __new__ And __init__ For Metaclasses

Metaclass Vs Inheritance For Predefined Class Creation

I'm writing some code for a program that will be able to run some software, read the inputs/out… Read more Metaclass Vs Inheritance For Predefined Class Creation

Python Apply Decorator To Every Method In A Class Without Inspect

Slightly modifying the answer from Applying python decorators to methods in a class, it is possible… Read more Python Apply Decorator To Every Method In A Class Without Inspect

The Built-in Keyword Type Means A Function Or A Class In Python?

In most posts, people often say type is a built-in function if it is provided with one argument, an… Read more The Built-in Keyword Type Means A Function Or A Class In Python?

What's The Correct Way To Implement A Metaclass With A Different Signature Than `type`?

Say I want to implement a metaclass that should serve as a class factory. But unlike the type const… Read more What's The Correct Way To Implement A Metaclass With A Different Signature Than `type`?

Is It Possible To Make The Output Of `type` Return A Different Class?

So disclaimer: this question has piqued my curiosity a bit, and I'm asking this for purely educ… Read more Is It Possible To Make The Output Of `type` Return A Different Class?