This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients StMark, eric.araujo, ezio.melotti, georg.brandl, ggenellina, terry.reedy
Date 2011-11-09.03:51:45
SpamBayes Score 1.16337e-11
Marked as misclassified No
Message-id <1320810706.69.0.970666788993.issue6570@psf.upfronthosting.co.za>
In-reply-to
Content
>Would adding 'required' before 'positional' and 'optional' before 'keyword arguments' be ok?

No! What is false in the original and the above is the equation and confusion of 'required' with 'positional' and 'optional' with 'keyword'. Required/optional is an argument property for all calls to a function as determined by the function definition.  Position/keyword is an argument property for each particular call as determined by the call itself (or the programmer thereof). The two contrasts are logically independent even if there is empirical correlation in the practice of some programmers. All arguments for parrot, both the required voltage argument and the three optional arguments, can be passed by either position or keyword. This is shown by the examples that pass both types of arguments both ways.

(Similarly, both required and optional args can be defined as (pass-by-)keyword-only arguments,
  >>> def f(a,b=2,*,c,d=4): return a,b,c,d
  >>> f(1,c=3)
  (1, 2, 3, 4)
though such possibilities are not relevant here.)

>> An argument for voltage is required, the other three are optional.

Prefix the above with "When calling this function,".

> That part refers to the function signature, not the function call.

I was specifically referring to calls. All parameters in a signature require an argument. A function signature may (optionally ;-) define an argument for any parameter as optional *in function call expressions* by giving an alternate default argument for the parameter.
History
Date User Action Args
2011-11-09 03:51:46terry.reedysetrecipients: + terry.reedy, georg.brandl, ggenellina, ezio.melotti, eric.araujo, StMark
2011-11-09 03:51:46terry.reedysetmessageid: <1320810706.69.0.970666788993.issue6570@psf.upfronthosting.co.za>
2011-11-09 03:51:46terry.reedylinkissue6570 messages
2011-11-09 03:51:45terry.reedycreate