<div dir="ltr">Interesting. I don't think I've ever seen it used, even having looked at Python 3 code. For those who have worked with more Python 3 code than I have, do you ever see it used?</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 17, 2015 at 12:02 PM Chris Kaynor <<a href="mailto:ckaynor@zindagigames.com">ckaynor@zindagigames.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><div>On Wed, Jun 17, 2015 at 11:58 AM, Amber Yust <span dir="ltr"><<a href="mailto:amber.yust@gmail.com" target="_blank">amber.yust@gmail.com</a>></span> wrote:<br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">One thing that has been a source of bugs and frustration in the past is the inability to designate a named keyword argument that cannot be passed as a positional argument (short of **kwargs and then keying into the dict directly). Has there been any previous discussion on the possibility of a means to designate named arguments as explicitly non-positional?<div><br></div><div>Not a solid proposal, but to capture the essential difference of what I'm thinking of, along the lines of...</div><div><br></div><div>    def foo(bar, baz=None, qux: None):</div><div><br></div><div>where bar is a required positional argument, baz is an optional argument that can have a value passed positionally or by name, and qux is an optional argument that must always be passed by keyword.</div><div><br></div><div>Such a means would help avoid cases where a misremembered function signature results in a subtle and likely unnoticed bug due to unintended parameter/argument mismatch.</div><div><br></div><div>(It's possible that this has been discussed before - a cursory search of python-ideas didn't bring up any direct discussion, but I may have missed something. If you have a link to prior discussion, please by all means point me at it!)</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">This feature was added to Python 3 about 9 years ago, see <a href="https://www.python.org/dev/peps/pep-3102/" target="_blank">https://www.python.org/dev/peps/pep-3102/</a>. A quick search for "python keyword only arguments" on Google found it.<div><br></div><div>Guido's time machine strikes again!</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div><div><div>Chris</div></div></div><div><br></div></div></div></div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a></blockquote></div>