[Python-Dev] PEP 457: Syntax For Positional-Only Parameters (original) (raw)
Anders J. Munch ajm at flonidan.dk
Wed Oct 9 16:45:44 CEST 2013
- Previous message: [Python-Dev] PEP 457: Syntax For Positional-Only Parameters
- Next message: [Python-Dev] PEP 457: Syntax For Positional-Only Parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Larry Hastings wrote:
I look forward to an alternate suggestion. This is the least-bad thing I could come up with.
How about a naming convention instead, where using a leading underscore in a parameter name is a hint that it is positional-only.
For example, the docstring of sorted: sorted(iterable, key=None, reverse=False) --> new sorted list would become: sorted(_iterable, key=None, reverse=False) --> new sorted list
It seems more intuitive than the slash, and requires no change to the toolchain.
Although, it may collide slightly with code that uses a leading underscore to indicate "implementation detail" for a parameter with a default value, but a quick scan of the std. lib. suggests that that's very rare.
regards, Anders
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20131009/bf61319b/attachment.html>
- Previous message: [Python-Dev] PEP 457: Syntax For Positional-Only Parameters
- Next message: [Python-Dev] PEP 457: Syntax For Positional-Only Parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]