On 10/9/2013 9:51 AM, Larry Hastings wrote:

Again, I don't expect this syntax to be implemented any time soon. But
this does raise a mild sore point: Maciej and Armin Rigo tell me that
PyPy's implementation of range() looks like this:

    def range(x, y=None, step=None):

The "None" above is not the Python None, it's RPython's internal None,
so it's not available to Python programs.  But this does mean range() in
PyPy accepts keyword parameters, and in fact this works:

    range(9, step=2)

That's way illegal in CPython.

But Georg's point is that it does not have to be illegal in CPython. Range, in particular, does not have to be blazingly fast since it wraps loops rather than being in loops. I quite agree that it would be better to fix most functions.

--
Terry Jan Reedy

_______________________________________________
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