@@ -66,7 +66,7 @@ URI is defined in :rfc:`std-66 <3986>`)::
6666 version_cmp = wsp* '<' | '<=' | '!=' | '==' | '>=' | '>' | '~=' | '==='
6767 version = wsp* ( letterOrDigit | '-' | '_' | '.' | '*' | '+' | '!' )+
6868 version_one = version_cmp version wsp*
69- version_many = version_one (wsp* ',' version_one)*
69+ version_many = version_one (',' version_one)* (',' wsp*)?
7070 versionspec = ( '(' version_many ')' ) | version_many
7171 urlspec = '@' wsp* <URI_reference>
7272
@@ -303,7 +303,7 @@ The complete parsley grammar::
303303 version_cmp = wsp* <'<=' | '<' | '!=' | '==' | '>=' | '>' | '~=' | '==='>
304304 version = wsp* <( letterOrDigit | '-' | '_' | '.' | '*' | '+' | '!' )+>
305305 version_one = version_cmp:op version:v wsp* -> (op, v)
306- version_many = version_one:v1 (wsp* ',' version_one)*:v2 -> [v1] + v2
306+ version_many = version_one:v1 (',' version_one)*:v2 (',' wsp*)? -> [v1] + v2
307307 versionspec = ('(' version_many:v ')' ->v) | version_many
308308 urlspec = '@' wsp* <URI_reference>
309309 marker_op = version_cmp | (wsp* 'in') | (wsp* 'not' wsp+ 'in')
@@ -424,6 +424,7 @@ A test program - if the grammar is in a string ``grammar``:
424424 " name" ,
425425 " name<=1" ,
426426 " name>=3" ,
427+ " name>=3," ,
427428 " name>=3,<2" ,
428429 " name@http://foo.com" ,
429430 " name [fred,bar] @ http://foo.com ; python_version=='2.7'" ,
@@ -481,6 +482,9 @@ History
481482 ``'.'.join(platform.python_version_tuple()[:2]) ``, to accommodate potential
482483 future versions of Python with 2-digit major and minor versions
483484 (e.g. 3.10). [#future_versions ]_
485+ - June 2024: The definition of ``version_many `` was changed to allow trailing
486+ commas, matching with the behavior of the Python implementation that has been
487+ in use since late 2022.
484488
485489
486490References
0 commit comments