Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #83611
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: annoying doctest problem |
| Date | 2015-01-12 14:59 +0000 |
| References | <0e9e5a03-2291-490e-9220-fa6744c9e2e5@googlegroups.com> <54b35a9c$0$2738$c3e8da3$76491128@news.astraweb.com> <mailman.17618.1421064945.18130.python-list@python.org> <54b3c566$0$13004$c3e8da3$5496439d@news.astraweb.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.17624.1421074803.18130.python-list@python.org> (permalink) |
On 12/01/2015 13:00, Steven D'Aprano wrote: > Skip Montanaro wrote: > >> ISTR that when Tim Peters first implemented first, the typical way you >> were expected to get tests into a doc string was to copy from an >> interactive session, which would not have this problem. > > I believe that is still documented as the way to generate doctests. > >> Also, to Steven's comment about fussiness, it isn't so much that it's >> fussy. It's more that it's dumb. I just does a simple string comparison of >> the expected and actual outputs. It would be impossible for doctest to >> know whether the expected output was something like repr or str output, >> and thus safe to exchange single for double (don't forget to escape other >> embedded quotes!), or was some sort of user-generated string, perhaps >> intended to be >> text in another programming language which has different quoting rules >> than Python. Therefore, fussy (or dumb) is exactly what you want. > > I didn't mean to give the impression that doctest was wrong to be fussy, or > dumb if you prefer. I think it's exactly the right behaviour. > If doctest is dumb then that's clearly down to the author. Perhaps we should refer him or her to the Zen of Python so they don't repeat the mistake with future design decisions? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
annoying doctest problem gordianknot1981@gmail.com - 2015-01-11 20:20 -0800
Re: annoying doctest problem gordianknot1981@gmail.com - 2015-01-11 20:30 -0800
Re: annoying doctest problem Steven D'Aprano <steve@pearwood.info> - 2015-01-12 05:24 +0000
Re: annoying doctest problem Skip Montanaro <skip.montanaro@gmail.com> - 2015-01-12 06:15 -0600
Re: annoying doctest problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-13 00:00 +1100
Re: annoying doctest problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-12 14:59 +0000
Re: annoying doctest problem Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-13 02:58 +1100
Re: annoying doctest problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-12 16:46 +0000
Re: annoying doctest problem Skip Montanaro <skip.montanaro@gmail.com> - 2015-01-12 12:15 -0600
Re: annoying doctest problem Skip Montanaro <skip.montanaro@gmail.com> - 2015-01-12 06:32 -0600
Re: annoying doctest problem Ned Batchelder <ned@nedbatchelder.com> - 2015-01-12 10:47 -0500
Re: annoying doctest problem gordianknot1981@gmail.com - 2015-01-12 10:34 -0800
csiph-web