3 ms·
There are some valid points buried in this comment, but they are deeper than you perhaps intended or even know. Metaclasses are widely used, but unless your sp
by orf 4y ago
There are some valid points buried in this comment, but they are deeper than you perhaps intended or even know.
Metaclasses are widely used, but unless your specific problem calls for their use then you won’t use them. Usually these problems are related to authoring a library.
How would isinstance work with List[int]? Would it do O(n) isinstance calls on each element? Python isn’t typed like that, and a list is not and never will be an instance of List[int].
The magic method resolution order is also pretty natural and fits (slots?) nicely into the mental model you develop whilst using Python.