I used "..." in my lib to do that :

from funcoperators import bracket

@bracket
def foo(x, y):
   print(x, y)

partialized = foo[..., 10]
partialized(5)

https://pypi.org/project/funcoperators/

Le dim. 23 juin 2019 à 21:34, James Lu <[email protected]> a écrit :
>
> Make $ a valid identifier and a singleton.
>
>
> $ is a useful placeholder in [].
>
>
> Possible function partial syntax:
>
>
> def foo(x, y):
>
>     print(x, y)
>
>
> partialized = foo[$, 10]
>
> partialized(5)
>
> # => 5 10
>
>
> _______________________________________________
> 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/V7ZCLM3RIVB7CM36OOVW7Q5TQLFGOPUA/
> 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/52GKJTA3NNJQX2NXX5NFHSJ2NSZ6OJUA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to