#!/usr/local/bin/python3 class classproperty(object): def __init__(self, getter): self.getter= getter def __get__(self, instance, owner): return self.getter(owner) class Foo(object): x= 4 @classproperty def number(cls): return cls.x print(Foo.number)