On 01/17/2018 08:14 AM, Serhiy Storchaka wrote: > 17.01.18 16:34, Victor Stinner пише: >> In Februrary 2017, I proposed on python-ideas to change the Python >> syntax to allow to declare positional-only parameters in Python: >> >> https://mail.python.org/pipermail/python-ideas/2017-February/044879.html >> https://mail.python.org/pipermail/python-ideas/2017-March/044956.html > > The main problem -- designing a syntax that does not look ugly. I > think there are too small time is left before features freezing for > experimenting with it. It would be better to make such changes at the > early stage of development. The syntax question is already solved: def some_func(a, b, /, this, that, *, the_other): # some stuff Everything before the slash is positional-only, between the slash and star is positional-or-keyword, and after the star is keyword-only. This is what is in our generated help(), and there is a nice symmetry between '/' and '*' being opposites, and positional/keyword being opposites. And slash is certainly no uglier than star. ;) -- ~Ethan~
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4