A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20131009/afcadf9c/attachment.html below:

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 10/09/2013 04:26 PM, Georg Brandl
      wrote:<br>
    </div>
    <blockquote cite="mid:l33p0b$u88$1@ger.gmane.org" type="cite">
      <blockquote type="cite">
        <pre wrap="">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.
</pre>
      </blockquote>
      <pre wrap="">
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.
</pre>
    </blockquote>
    <br>
    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 <br>
    <br>
    Similarly, you can't accurately express the semantics of range's
    arguments using default values.  PyPy's approach is approximately
    like this:<br>
    <blockquote>def range(x, y=None, step=None):<br>
          step = 1 if step is None else step<br>
          if y is not None:<br>
              start, stop = x, y<br>
          else:<br>
              start, stop = 0, x<br>
    </blockquote>
    But now introspection information on range() is inaccurate and
    unhelpful.  (Not to mention, they allow specifying step without
    specifying y, by using keyword arguments.)<br>
    <br>
    My goal in writing the PEP was to codify existing practice, which
    meant reflecting these (annoying!) corner cases accurately.<br>
    <br>
    <br>
    <i>/arry</i><br>
  </body>
</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