Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
documentation of arguments
#6
(Nov-29-2016, 11:04 PM)nilamo Wrote: It looks like with python 3.0, a PEP3102 added keyword-only support (although this doesn't throw errors):
>>> def spam(eggs, *whocares, fish="fried"): print(fish)
...
That's not the correct syntax, your code allows an arbitrary number of positional arguments.
You want this instead:
def spam(eggs,*,fish="fried"):
(Nov-29-2016, 11:04 PM)nilamo Wrote: But then again, the docs for 3.0's sorted do indicate that they're keyword only:
Looks like that is indeed the case in python 3, and the docs clearly state it.
Considering the docs for min and max, I'd say the function signature of sorted in the docs should be updated.
Reply


Messages In This Thread
documentation of arguments - by Skaperen - Nov-28-2016, 06:28 AM
RE: documentation of arguments - by stranac - Nov-28-2016, 08:58 AM
RE: documentation of arguments - by nilamo - Nov-29-2016, 11:04 PM
RE: documentation of arguments - by stranac - Nov-30-2016, 08:26 AM
RE: documentation of arguments - by Skaperen - Dec-02-2016, 07:56 AM
RE: documentation of arguments - by Larz60+ - Nov-28-2016, 03:51 PM
RE: documentation of arguments - by Larz60+ - Nov-28-2016, 06:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Functions (Arguments Passing,Changing a mutable ,Assignment to Arguments Names) Adelton 2 3,946 Mar-02-2017, 10:23 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020