""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: >>> Now, suppose you wanted to have 'key' be a keyword-only argument. >> >> Why? Why not let the user type the additional argument(s) without the >> parameter name? > > Are you asking why that feature (keyword-only arguments) is desirable? > That's the whole point of the PEP. Or are you asking why the user > shouldn't be allowed to pass keyword-only arguments by omitting the > keyword? Because they wouldn't be keyword-only arguments then, anymore.
There are two subproposals: first, keyword-only args after a variable number of positional args, which requires allowing keyword parameter specifications after the *args parameter, and second, keyword-only args after a fixed number number of positional args, implemented with a naked '*'. To the first, I said "The rationale for this is pretty obvious.". To the second, I asked, and still ask, "Why?". Talin himself said today in a followup post: > One suggestion I would have would be to implement the two parts of the > PEP (keyword-only arguments vs. the 'naked star' syntax) as two > separate patches; While there seems to be a relatively wide-spread > support for the former, the latter is still somewhat controversial and > will require further discussion. My "Why?" was and is exactly a request for that further discussion. Again: if a function has a fixed number n of params, why say that the first k can be passed by position, while the remaining n-k *must* be passed by name? Terry Jan Reedy
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com