On 10/09/2013 04:26 PM, Georg Brandl wrote: >> I realize you are -1 on the proposal in general, but I'd be very interested if >> you could propose an alternate approach where I didn't need "a new spelling for >> None" as you put it. > I think I would make Steven's proposed syntax mandatory: let the implementor > of the function decide which value stands for "not given" -- just like we do > in the C version, BTW. But that's not how addch works. addch counts how many arguments it received; if it is called with one or two, it does one thing, and if it's called with three or four it does something else. You can't duplicate these semantics with Similarly, you can't accurately express the semantics of range's arguments using default values. PyPy's approach is approximately like this: def range(x, y=None, step=None): step = 1 if step is None else step if y is not None: start, stop = x, y else: start, stop = 0, x But now introspection information on range() is inaccurate and unhelpful. (Not to mention, they allow specifying step without specifying y, by using keyword arguments.) My goal in writing the PEP was to codify existing practice, which meant reflecting these (annoying!) corner cases accurately. //arry/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20131009/afcadf9c/attachment.html>
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