class Meta(type):

    def __new__(mcl, *a, **k):
        uniquemcl = type('Uniq', (mcl,), {})
return type.__new__(uniquemcl, *a, **k)


class X(metaclass=Meta):
    pass


class Y(metaclass=Meta):
    pass
type(X).foo = property(lambda *_: 23)
type(Y).foo = property(lambda *_: 45)
X.foo
Y.foo
Class-level read-only properties in Python