It's been said, but one more tidbit:
On Sun, Jun 28, 2020 at 10:32 PM Steven D'Aprano firstname.lastname@example.org wrote:
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
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 -- email@example.com To unsubscribe send an email to firstname.lastname@example.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://email@example.com/message/TGGNWJ... Code of Conduct: http://python.org/psf/codeofconduct/
-- Christopher Barker, PhD
Python Language Consulting