Hacker News new | ask | show | jobs
by scoutoss11235 3608 days ago
In general, classmethod and staticmethod and property should almost always be the last decorator applied if you decorate a method multiple times in Python. This is because, unlike most decorators, classmethod/staticmethod/property don't return functions; they return objects that implement Python's descriptor protocol (https://docs.python.org/3/howto/descriptor.html) slightly differently than how it's implemented by functions. (The core of how methods work in Python is based on the fact that functions are just descriptors (https://docs.python.org/3/howto/descriptor.html#functions-an...).