In theory it could be checked to see if a given function exists in the same
namespace as a given variable if it doesn't exist in it that variable's
object's method resolution order and try calling it using the syntax
described here, but I don't think it affords the language any added
elegance or communicative power.

It would have to be determined which takes precedence when a class has a
certain method that shares a name with one in the same namespace as an
instance. If a method with a given name is not part of a class, the
proposed syntax would cause what function calls are valid for a given
instance to sometimes be context dependent rather than dependent only on
the definition of the class. I'm concerned about what this would mean for
language learning and debugging.

The potential use case seems to be tied to nested function calls that take
one argument in the innermost call. If we were to change the syntax to
streamline these constructions, I'd want to see composite functions with @
revisited.

Steele

On Sun, Jun 28, 2020, 11:00 AM <[email protected]> wrote:

> Is possible some day add Uniform Function Call Syntax (UFCS) in Python
> like Dlang?
>
> Example:
> https://tour.dlang.org/tour/en/gems/uniform-function-call-syntax-ufcs
> _______________________________________________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/[email protected]/message/UBGJ7K5YAYZSREN2QSTUEMLAS4JMYUCU/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/X5XZYNJN5T4C2R2XZE6LTYKW3WSGSUDD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to