You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here it is not the names args and kwargs that are important, but the * characters preceding them. args and kwargs are just the variable names often used by convention, short for "arguments" and "keyword arguments". The operative difference is the asterisk characters: a single * before a variable means "expand this as a sequence", while a double ** before a variable means "expand this as a dictionary". In fact, this syntax can be used not only with the function definition, but with the function call as well!
This seems to be the first time that sequence concept is mentioned. Given that there are many types of sequences and the concept is worth an aside, would it be a good idea to link to Sequence Types in the Python documentation?
Not sure if it is worth weaving in the broader concept of sequences or re-phrasing to restrict the example to just tuples.
The text was updated successfully, but these errors were encountered:
project-delphi
changed the title
Add link to sequences
Add link to Python 3 sequences documentation
Jul 5, 2020
In *args and **kwargs: Flexible Arguments section of the link, there is this paragraph:
This seems to be the first time that sequence concept is mentioned. Given that there are many types of sequences and the concept is worth an aside, would it be a good idea to link to Sequence Types in the Python documentation?
Not sure if it is worth weaving in the broader concept of sequences or re-phrasing to restrict the example to just tuples.
The text was updated successfully, but these errors were encountered: