Message186324
| Author |
triquetra011 |
| Recipients |
ezio.melotti, mrabarnett, triquetra011 |
| Date |
2013年04月08日.18:18:58 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1365445138.49.0.018016443065.issue17668@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Tested in 2.7 but possibly affects the other versions as well.
A real life example (note the first character '>' being lost):
>>> import re
>>> re.split(r'^>(.*)$', '>Homo sapiens catenin (cadherin-associated)')
produces:
['', 'Homo sapiens catenin (cadherin-associated)', '']
Expected (and IMHO most useful) behaviour would be for it to return:
['', '>Homo sapiens catenin (cadherin-associated)', '']
or (IMHO much less useful as one can already get this one just by adding external grouping parentheses and it is ):
['', '>Homo sapiens catenin (cadherin-associated)', 'Homo sapiens catenin (cadherin-associated)', '']
Not sure whether it can be changed in such a mature and widely used module without breaking compatibility but just adding a new optional parameter for deciding how re.split() deals with patterns containing grouping parentheses and making it default to the current behaviour would be very helpful.
Best Regards |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年04月08日 18:18:58 | triquetra011 | set | recipients:
+ triquetra011, ezio.melotti, mrabarnett |
| 2013年04月08日 18:18:58 | triquetra011 | set | messageid: <1365445138.49.0.018016443065.issue17668@psf.upfronthosting.co.za> |
| 2013年04月08日 18:18:58 | triquetra011 | link | issue17668 messages |
| 2013年04月08日 18:18:58 | triquetra011 | create |
|