Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What do * and / mean?
#4
(Dec-11-2022, 06:53 AM)perfringo Wrote: I suggest to read documentation Function definitions

Quote: When one or more parameters have the form parameter = expression, the function is said to have “default parameter values.” For a parameter with a default value, the corresponding argument may be omitted from a call, in which case the parameter’s default value is substituted. If a parameter has a default value, all following parameters up until the “*” must also have a default value — this is a syntactic restriction that is not expressed by the grammar.

Quote: Parameters before “/” are positional-only parameters and may only be passed by positional arguments.

(Dec-11-2022, 06:56 AM)Gribouillis Wrote: PEP 570 is also worth reading about this matter.

Oh, I see. These are separators!

Thank you, both guys, Mr. perfringo and Mr. Gribouillis.
I really appreciate you guys!
Reply


Messages In This Thread
What do * and / mean? - by cametan_001 - Dec-11-2022, 06:29 AM
RE: What do * and / mean? - by perfringo - Dec-11-2022, 06:53 AM
RE: What do * and / mean? - by Gribouillis - Dec-11-2022, 06:56 AM
RE: What do * and / mean? - by cametan_001 - Dec-11-2022, 07:27 AM

Forum Jump:

User Panel Messages

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