Hacker News new | past | comments | ask | show | jobs | submit login

One of the use-cases for positional-only arguments strikes me as being very sensible:

    def my_format(fmt, *args, **kwargs):
        ...
        fmt.format(*args, **kwargs)
suffers from a bug if you want to pass fmt as a keyword argument (e.g. `my_format('{fmt}', fmt='int')`). With positional-only arguments that goes away.

You could always force developers into using your code the way you expect by parsing args/kwargs yourself, so it's not like this really changes anything about the "restrictiveness" of the language.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: