Guido van Rossum wrote: > On 5/14/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >> More importantly, it seems to go against the grain of at least my >> mental concept of Python call signatures, in which arguments are >> inherently *named* (and can be passed using explicit names), with >> only rare exceptions like range(). In contrast, the languages that >> have this sort of positional thing only allow arguments to be >> specified by position, IIRC. That's what makes me uncomfortable with it. > > Well, in *my* metnal model the argument names are just as often > irrelevant as they are useful. I'd be taken aback if I saw this in > someone's code: open(filename="/etc/passwd", mode="r"). Perhaps it's > too bad that Python cannot express the notion of "these parameters are > positional-only" except very clumsily.
The idea of positional-only arguments came up during the PEP 3102 discussions. I believe the proposal was to allow a tuple of annotated names instead of a single name for the varargs parameter: @overloadable def range(*(start:int, stop:int, step:int)): ... # implement xrange @range.overload def range(*(stop:int,)): return range(0, x, 1) @range.overload def range(*(start:int, stop:int)): return range(x, y, 1) PJE's approach (using *args in the base signature, but allowing overloads to omit it) is probably cleaner, though. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com