Message134278
| Author |
Devin Jeanpierre |
| Recipients |
Devin Jeanpierre |
| Date |
2011年04月22日.19:31:20 |
| SpamBayes Score |
2.6675427e-05 |
| Marked as misclassified |
No |
| Message-id |
<1303500682.88.0.595944133083.issue11909@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
From the doctest source:
'Option directives are comments starting with "doctest:". Warning: this may give false positives for string-literals that contain the string "#doctest:". Eliminating these false positives would require actually parsing the string; but we limit them by ignoring any line containing "#doctest:" that is *followed* by a quote mark.'
This isn't a huge deal, but it's a bit annoying. Above being confusing, this is in contradiction with the doctest documentation, which states:
'Doctest directives are expressed as a special Python comment following an example’s source code'
No mention is made of this corner case where the regexp breaks.
As per the comment in the source, the patched version parses the source using the tokenize module, and runs a modified directive regex on all comment tokens to find directives. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年04月22日 19:31:22 | Devin Jeanpierre | set | recipients:
+ Devin Jeanpierre |
| 2011年04月22日 19:31:22 | Devin Jeanpierre | set | messageid: <1303500682.88.0.595944133083.issue11909@psf.upfronthosting.co.za> |
| 2011年04月22日 19:31:22 | Devin Jeanpierre | link | issue11909 messages |
| 2011年04月22日 19:31:21 | Devin Jeanpierre | create |
|