On Sun, Jun 28, 2020 at 02:23:38PM -0000, email@example.com wrote:
Is possible some day add Uniform Function Call Syntax (UFCS) in Python like Dlang?
That converts calls like:
I don't think that will be a good match for Python. In D, the compiler can decide at compile time:
and so convert the method call to a function call at compile time, with no loss of efficiency or safety.
But in Python, none of that information is available until runtime:
So all of that would have to happen at run time. That means that using
UFCS would make slow code. The interpreter would have to try calling
a.fun(), and if that failed with an AttributeError, it would then try