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/73b62b05/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 10:46 PM, Mark Shannon
      wrote:<br>
    </div>
    <blockquote cite="mid:5255C088.6020107@hotpy.org" type="cite">There
      is no need to create an "undefined" value.
      <br>
      Rather than define a parameter by assigning a fake value, just
      don't define it. We already do this for non-parameter locals and
      it could be extended to parameters.
      <br>
      <br>
      'range' would be defined thus:
      <br>
      <br>
      def range([start,] stop, [step], /):
      <br>
          try:
      <br>
              start
      <br>
          except UnboundLocalError:
      <br>
              start = 0
      <br>
          try:
      <br>
              step
      <br>
          except UnboundLocalError:
      <br>
              step = 1
      <br>
          ...
      <br>
    </blockquote>
    <br>
    That's a clever, and intuitive, idea.  Though the try/excepts look
    awfully clumsy.<br>
    <br>
    Perhaps we could add (egad, no, I can't believe I'm saying this) a
    new built-in function that tells you whether or not a local variable
    has been assigned to yet?<br>
    <blockquote>def range([start,] stop, [step], /): <br>
          if not bound(start):<br>
              start = 0 <br>
          if not bound(step):<br>
              step = 1 <br>
          ... <br>
    </blockquote>
    <br>
    <br>
    Anyway, this section is in the "Notes For Future Implementors"
    section, so as long as we never actually implement the syntax we
    don't need to solve the problem.<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