And mypy
is therefore telling me that perfectly functional and safe code has a type error that it just isn’t smart enough to figure out doesn’t exists and gives confusing error messages.
yes, there is: Reduce metaclass conflicts with less eager proclamation, automatic metaclass merges
Not sure if you saw these discussions, but the problem is that metaclasses don’t compose, so it’s best to avoid them as much as possible if you want your code to be modular and reusable. (it’s not possible for your singletons to also subclass any ABC for example, at least not without extra effort.)