Mostly for fun (but you never know if somebody wants to take this seriously), let me mention that Python 3.8 allows abusing the CALL_METHOD
optimization to make a “method” call like obj.meth()
behave differently from x = obj.meth; x()
. So it is technically possible to define a special descriptor denominator
such that q.denominator
and q.denominator()
both work. But that’s very much relying on internals of the CPython interpreter.