It's been said, but one more tidbit:

On Sun, Jun 28, 2020 at 10:32 PM Steven D'Aprano <> wrote:
- the compiler doesn't know what type `a` will have;
- whether or not it has a `fun` method;
- whether or not there is a global function `fun`;
- and whether it takes an argument matching `a`.

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
``, and if that failed with an AttributeError, it would then try
`fun(a)` instead.

and then it would have to see if fun(a) was successful, as there would be no way to know if 'a' was indeed a type that fun() could be called on -- AND you'd never know if it did the right thing it if happened not to fail.

if fun() is method of the a object, you know that it will be passed a a object as it's first parameter (self) -- but stand alone? there is no way to know that that's the function that's wanted.



Python-ideas mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct:

Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython