Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the purpose of ','. expression in Python grammar specification?

Can you help me with the args part in Python grammar specification?

args:
    | ','.(starred_expression | ( assignment_expression | expression !':=') !'=')+ [',' kwargs ] 
    | kwargs 

Especially this part: ','.(starred_expression | ( assignment_expression | expression !':=') !'=')+. What does ','. mean?

I checked https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form and https://en.wikipedia.org/wiki/Parsing_expression_grammar, but could not find a reference to that.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

PEP 617 describes the syntax used by the grammar specification. In particular, s.e+ means one or more es separated by ss.

So args is a sequence of one or more various expressions separated by commas.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading