@@ -66,7 +66,7 @@ URI is defined in :rfc:`std-66 <3986>`)::
66
66
version_cmp = wsp* '<' | '<=' | '!=' | '==' | '>=' | '>' | '~=' | '==='
67
67
version = wsp* ( letterOrDigit | '-' | '_' | '.' | '*' | '+' | '!' )+
68
68
version_one = version_cmp version wsp*
69
- version_many = version_one (wsp* ',' version_one)*
69
+ version_many = version_one (',' version_one)* (',' wsp*)?
70
70
versionspec = ( '(' version_many ')' ) | version_many
71
71
urlspec = '@' wsp* <URI_reference>
72
72
@@ -303,7 +303,7 @@ The complete parsley grammar::
303
303
version_cmp = wsp* <'<=' | '<' | '!=' | '==' | '>=' | '>' | '~=' | '==='>
304
304
version = wsp* <( letterOrDigit | '-' | '_' | '.' | '*' | '+' | '!' )+>
305
305
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
307
307
versionspec = ('(' version_many:v ')' ->v) | version_many
308
308
urlspec = '@' wsp* <URI_reference>
309
309
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``:
424
424
" name" ,
425
425
" name<=1" ,
426
426
" name>=3" ,
427
+ " name>=3," ,
427
428
" name>=3,<2" ,
428
429
" name@http://foo.com" ,
429
430
" name [fred,bar] @ http://foo.com ; python_version=='2.7'" ,
@@ -481,6 +482,9 @@ History
481
482
``'.'.join(platform.python_version_tuple()[:2]) ``, to accommodate potential
482
483
future versions of Python with 2-digit major and minor versions
483
484
(e.g. 3.10). [#future_versions ]_
485
+ - May 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.
484
488
485
489
486
490
References
0 commit comments