[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-08-09 Thread Brian Skinn
Brian Skinn added the comment: On reflection, it would probably be better to limit the ELLIPSIS to 3 or 4 periods ('[.]{3,4}'); otherwise, it would be impossible to express an ellipsis followed by a period in a 'want'. -- ___ Python tracker

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-08-09 Thread Brian Skinn
Brian Skinn added the comment: I suppose one alternative solution might be to tweak the ELLIPSIS feature of doctest, such that it would interpret a run of >=3 periods in a row (matching regex pattern of "[.]{3,}") as 'ellipsis'. The regex for PS2 could then have a negative lookahead added, s

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-08-09 Thread Brian Skinn
Brian Skinn added the comment: Mm, agreed--that regex wouldn't be hard to write. The problem is, AFAICT there's irresolvable syntactic ambiguity in a line starting with exactly three periods, if the doctest PS2 specification is not constrained to be exactly "... ". In such a case, "..." could

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-08-09 Thread Paul Moore
Paul Moore added the comment: It shouldn't be hard to update the regex to accept either "... " followed by other text or "..." on a line on its own, surely? -- nosy: +paul.moore ___ Python tracker _

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-04-26 Thread Brian Skinn
Brian Skinn added the comment: Ahh, this *will* break some doctests: any with blank PS2 lines in the 'source' portion without the explicit trailing space: 1] >>> def foo(): 2] ...print("bar") 3] ... 4] ...print("baz") 5] >>> foo() 6] bar 7] baz If line 3 contains exactly "..." instea

[issue36714] Tweak doctest 'example' regex to allow a leading ellipsis in 'want' line

2019-04-24 Thread Brian Skinn
New submission from Brian Skinn : doctest requires code examples have PS1 as ">>> " and PS2 as "... " -- that is, each is three printed characters, followed by a space: ``` $ cat ell_err.py import doctest class Foo: """Test docstring. >>>print("This is a test sentence.") ...a tes