On Sat, Feb 11, 2017 at 12:57 AM, eryk sun <eryk...@gmail.com> wrote:
> > The '/' syntax for positional-only arguments is documented in PEP 457. > > https://www.python.org/dev/peps/pep-0457 At https://www.python.org/dev/peps/pep-0457/#id14 in PEP 457 it says: <quote> >From the "ten-thousand foot view", and ignoring *args and **kwargs for now, the grammar for a function definition currently looks like this: def name(positional_or_keyword_parameters, *, keyword_only_parameters): Building on that perspective, the new syntax for functions would look like this: def name(positional_only_parameters, /, positional_or_keyword_parameters, *, keyword_only_parameters): All parameters before the / are positional-only. If / is not specified in a function signature, that function does not accept any positional-only parameters. </quote> Has this PEP been implemented yet? I am running Python 3.5.2 and it appears not to work. Also, in "What's New In Python 3.6" (https://docs.python.org/3/whatsnew/3.6.html) I did not see a mention of it. > Also see the how-to for CPython's "Argument Clinic" preprocessor, > since (for now) positional-only arguments are only a concern for > built-in functions. So I am assuming this syntax is only being used for some built-in functions? You have provided a lot of interesting information. I'm not sure if I am comprehending everything, but it has made interesting reading and Googling tonight. Enough so that I have stayed up much later than I meant to! Thanks! -- boB _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor