On 10/10/13 09:51, Larry Hastings wrote:
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?

    def range([start,] stop, [step], /):
         if not bound(start):
             start = 0
         if not bound(step):
             step = 1
         ...

It couldn't be a function in the usual sense, because attempting to
evaluate the unbound parameter would raise an exception before the
function was called.

It would have to be something magical, probably a new piece of
syntax understood by the compiler.

--
Greg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to