On 5/20/13, Mark Janssen wrote:
>>> * Doctests practically beg you to write your code first and then copy
>>> and
>>> paste terminal sessions - they're the enemy of TDD
>>
>> Of course , not , all the opposite . If the approach is understood
>> correctly then the first thing test author will do is
>> * Doctests practically beg you to write your code first and then copy and
>> paste terminal sessions - they're the enemy of TDD
>
> Of course , not , all the opposite . If the approach is understood
> correctly then the first thing test author will do is to write the
> code «expected» to get som
On 5/20/13, Olemis Lang wrote:
[...]
> On 5/20/13, Michael Foord wrote:
[...]
>
>> * Tool support for editing within doctests is *generally* worse
>
> this is true , let's do it !
>
[...]
>> * Typing >>> and ... all the time is really annoying
>
> ... I have faith ... there should be something li
Hi !
... sorry , I could not avoid to reply this message ...
On 5/20/13, Michael Foord wrote:
>
> On 20 May 2013, at 18:26, Mark Janssen wrote:
>
I'm hoping that core developers don't get caught-up in the "doctests are
bad
meme".
Instead, we should be clear about their p
On 5/19/2013 9:08 PM, Ethan Furman wrote:
On 05/19/2013 05:24 PM, Nick Coghlan wrote:
This is the point I was trying to make: once you use IntEnum (as you
would in any case where you need bitwise operators), Enum gets out of
the way for everything other than __str__, __repr__, and one other
slo
I don't think a python-dev discussion about the value of doctests is going to
change minds one way or the other, but I just *had* to respond to this one
point:
On May 20, 2013, at 11:26 PM, Michael Foord wrote:
>* Doctests practically beg you to write your code first and then copy and
>* paste te
On 20 May 2013, at 18:26, Mark Janssen wrote:
>>> I'm hoping that core developers don't get caught-up in the "doctests are bad
>>> meme".
>>>
>>> Instead, we should be clear about their primary purpose which is to test
>>> the examples given in docstrings.
>>> In other words, doctests have a pe
On 5/19/13, Steven D'Aprano wrote:
> On 20/05/13 09:27, Gregory P. Smith wrote:
>> On Sat, May 18, 2013 at 11:41 PM, Raymond Hettinger <
>> raymond.hettin...@gmail.com> wrote:
>>
>>>
>>> On May 14, 2013, at 9:39 AM, Gregory P. Smith wrote:
>>>
>>> Bad: doctests.
>>>
>>>
>>> I'm hoping that core d
>> I'm hoping that core developers don't get caught-up in the "doctests are bad
>> meme".
>>
>> Instead, we should be clear about their primary purpose which is to test
>> the examples given in docstrings.
>> In other words, doctests have a perfectly legitimate use case.
>
> But more than just one
-- Forwarded message --
From: Olemis Lang
Date: Mon, 20 May 2013 11:33:42 -0500
Subject: Re: [Python-Dev] Purpose of Doctests [Was: Best practices for Enum]
To: Antoine Pitrou
On 5/20/13, Antoine Pitrou wrote:
> On Sat, 18 May 2013 23:41:59 -0700
> Raymond Hettinger
Hi !
:)
I'll be replying some individual messages in this thread in spite of
putting my replies in the right context . Sorry if I repeat something
, or this makes the thread hard to read . Indeed , IMHO this is a
subject suitable to discuss in TiP ML .
On 5/19/13, Gregory P. Smith wrote:
> On Sa
On Tue, 21 May 2013 02:00:32 +1000
Steven D'Aprano wrote:
> On 20/05/13 23:38, Antoine Pitrou wrote:
> > On Mon, 20 May 2013 23:32:10 +1000
> > Steven D'Aprano wrote:
> >> On 20/05/13 20:45, Antoine Pitrou wrote:
> >>> On Sat, 18 May 2013 23:41:59 -0700
> >>> Raymond Hettinger wrote:
>
> >
On 20/05/13 23:38, Antoine Pitrou wrote:
On Mon, 20 May 2013 23:32:10 +1000
Steven D'Aprano wrote:
On 20/05/13 20:45, Antoine Pitrou wrote:
On Sat, 18 May 2013 23:41:59 -0700
Raymond Hettinger wrote:
We should continue to encourage users to make thorough unit tests
and to leave doctests for
On May 19, 2013, at 04:27 PM, Gregory P. Smith wrote:
>Idea: I don't believe anybody has written a fixer for lib2to3 that applies
>fixers to doctests. That'd be an interesting project for someone.
I'm not sure that's true. I don't use 2to3 anymore if I can help it, but I'm
pretty sure you can 2
On May 19, 2013, at 07:28 PM, Tim Peters wrote:
>But more than just one ;-) Another great use has nothing to do with
>docstrings: using an entire file as "a doctest". This encourages
>writing lots of text explaining what you're doing,. with snippets of
>code interspersed to illustrate that the
On May 18, 2013, at 11:41 PM, Raymond Hettinger wrote:
>I'm hoping that core developers don't get caught-up in the "doctests are bad
>meme".
Thanks for your message Raymond. I know that doctests are controversial, but
I do firmly believe that when used correctly, they have value and should not
b
On Mon, 20 May 2013 15:57:35 +0200, Antoine Pitrou wrote:
> On Mon, 20 May 2013 09:37:32 -0400
> "R. David Murray" wrote:
> > On Mon, 20 May 2013 12:45:57 +0200, Antoine Pitrou
> > wrote:
> > > On Sat, 18 May 2013 23:41:59 -0700
> > > Raymond Hettinger wrote:
> > > >
> > > > We should continu
On Mon, 20 May 2013 09:37:32 -0400
"R. David Murray" wrote:
> On Mon, 20 May 2013 12:45:57 +0200, Antoine Pitrou
> wrote:
> > On Sat, 18 May 2013 23:41:59 -0700
> > Raymond Hettinger wrote:
> > >
> > > We should continue to encourage users to make thorough unit tests
> > > and to leave doctest
On Mon, 20 May 2013 12:45:57 +0200, Antoine Pitrou wrote:
> On Sat, 18 May 2013 23:41:59 -0700
> Raymond Hettinger wrote:
> >
> > We should continue to encourage users to make thorough unit tests
> > and to leave doctests for documentation. That said, it should be
> > recognized that some testi
On Mon, 20 May 2013 23:32:10 +1000
Steven D'Aprano wrote:
> On 20/05/13 20:45, Antoine Pitrou wrote:
> > On Sat, 18 May 2013 23:41:59 -0700
> > Raymond Hettinger wrote:
> >>
> >> We should continue to encourage users to make thorough unit tests
> >> and to leave doctests for documentation. That
On 20/05/13 20:45, Antoine Pitrou wrote:
On Sat, 18 May 2013 23:41:59 -0700
Raymond Hettinger wrote:
We should continue to encourage users to make thorough unit tests
and to leave doctests for documentation. That said, it should be
recognized that some testing is better than no testing. And
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/19/2013 07:22 PM, Mark Janssen wrote:
> On Sun, May 19, 2013 at 1:13 PM, Tres Seaver
> wrote:
>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
>>
>> On 05/19/2013 10:48 AM, Guido van Rossum wrote:
>>> Anyway, if you're doing arithmetic on enums
On Sat, 18 May 2013 23:41:59 -0700
Raymond Hettinger wrote:
>
> We should continue to encourage users to make thorough unit tests
> and to leave doctests for documentation. That said, it should be
> recognized that some testing is better than no testing. And doctests
> may be attractive in that
On Mon, May 20, 2013 at 1:51 AM, Gregory P. Smith wrote:
>
> On May 19, 2013 4:31 PM, "Benjamin Peterson" wrote:
>>
>> 2013/5/19 Gregory P. Smith :
>> > Idea: I don't believe anybody has written a fixer for lib2to3 that
>> > applies
>> > fixers to doctests. That'd be an interesting project for s
On 05/19/2013 05:24 PM, Nick Coghlan wrote:
This is the point I was trying to make: once you use IntEnum (as you
would in any case where you need bitwise operators), Enum gets out of
the way for everything other than __str__, __repr__, and one other
slot (that escapes me for the moment...).
__
Gregory P. Smith writes:
> I really do applaud the goal of keeping examples in documentation up to
> date. But doctest as it is today is the wrong approach to that. A repr
> mismatch does not mean the example is out of date.
Of course it does. The user sees something in the doc that's
differ
On 20/05/13 09:27, Gregory P. Smith wrote:
On Sat, May 18, 2013 at 11:41 PM, Raymond Hettinger <
raymond.hettin...@gmail.com> wrote:
On May 14, 2013, at 9:39 AM, Gregory P. Smith wrote:
Bad: doctests.
I'm hoping that core developers don't get caught-up in the "doctests are
bad meme".
So
[Raymond Hettinger]
> I'm hoping that core developers don't get caught-up in the "doctests are bad
> meme".
>
> Instead, we should be clear about their primary purpose which is to test
> the examples given in docstrings.
I disagree.
> In many cases, there is a great deal of benefit to docstrin
On Mon, May 20, 2013 at 10:14 AM, Antoine Pitrou wrote:
> On Sun, 19 May 2013 20:04:03 -0400
> Ned Batchelder wrote:
>> On 5/19/2013 7:22 PM, Mark Janssen wrote:
>> > On Sun, May 19, 2013 at 1:13 PM, Tres Seaver wrote:
>> >> -BEGIN PGP SIGNED MESSAGE-
>> >> Hash: SHA1
>> >>
>> >> On 05/1
On Sun, 19 May 2013 20:04:03 -0400
Ned Batchelder wrote:
> On 5/19/2013 7:22 PM, Mark Janssen wrote:
> > On Sun, May 19, 2013 at 1:13 PM, Tres Seaver wrote:
> >> -BEGIN PGP SIGNED MESSAGE-
> >> Hash: SHA1
> >>
> >> On 05/19/2013 10:48 AM, Guido van Rossum wrote:
> >>> Anyway, if you're do
On 5/19/2013 7:22 PM, Mark Janssen wrote:
On Sun, May 19, 2013 at 1:13 PM, Tres Seaver wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/19/2013 10:48 AM, Guido van Rossum wrote:
Anyway, if you're doing arithmetic on enums you're doing it wrong.
Hmm, bitwise operations, even?
I thi
On May 19, 2013 4:31 PM, "Benjamin Peterson" wrote:
>
> 2013/5/19 Gregory P. Smith :
> > Idea: I don't believe anybody has written a fixer for lib2to3 that
applies
> > fixers to doctests. That'd be an interesting project for someone.
>
> 2to3 can operate on doctests, though it doesn't do anything
2013/5/19 Gregory P. Smith :
> Idea: I don't believe anybody has written a fixer for lib2to3 that applies
> fixers to doctests. That'd be an interesting project for someone.
2to3 can operate on doctests, though it doesn't do anything different
to them than it does to normal sourcecode.
--
Regar
On Sat, May 18, 2013 at 11:41 PM, Raymond Hettinger <
raymond.hettin...@gmail.com> wrote:
>
> On May 14, 2013, at 9:39 AM, Gregory P. Smith wrote:
>
> Bad: doctests.
>
>
> I'm hoping that core developers don't get caught-up in the "doctests are
> bad meme".
>
So long as doctests insist on compar
On Sun, May 19, 2013 at 1:13 PM, Tres Seaver wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 05/19/2013 10:48 AM, Guido van Rossum wrote:
>> Anyway, if you're doing arithmetic on enums you're doing it wrong.
>
> Hmm, bitwise operations, even?
I think it's rather pointless to do bi
On 20 May 2013 06:25, "Terry Jan Reedy" wrote:
>
> On 5/19/2013 4:13 PM, Tres Seaver wrote:
>>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On 05/19/2013 10:48 AM, Guido van Rossum wrote:
>>>
>>> Anyway, if you're doing arithmetic on enums you're doing it wrong.
>>
>>
>> Hmm, bitwise
On 5/19/2013 4:13 PM, Tres Seaver wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/19/2013 10:48 AM, Guido van Rossum wrote:
Anyway, if you're doing arithmetic on enums you're doing it wrong.
Hmm, bitwise operations, even?
Those are logic, not arithmetic as usually understood. (Th
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/19/2013 12:14 PM, Dan Stromberg wrote:
> On Sat, May 18, 2013 at 11:41 PM, Raymond Hettinger <
> raymond.hettin...@gmail.com> wrote:
>
>>
>> On May 14, 2013, at 9:39 AM, Gregory P. Smith
>> wrote:
>>
>> Bad: doctests.
>>
>>
>> I'm hoping t
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 05/19/2013 10:48 AM, Guido van Rossum wrote:
> Anyway, if you're doing arithmetic on enums you're doing it wrong.
Hmm, bitwise operations, even?
Tres.
- --
===
Tres Seaver
On Sat, May 18, 2013 at 11:41 PM, Raymond Hettinger <
raymond.hettin...@gmail.com> wrote:
>
> On May 14, 2013, at 9:39 AM, Gregory P. Smith wrote:
>
> Bad: doctests.
>
>
> I'm hoping that core developers don't get caught-up in the "doctests are
> bad meme".
>
Don't doctests intended for CPython
Anyway, if you're doing arithmetic on enums you're doing it wrong.
—
Sent from Mailbox
On Sun, May 19, 2013 at 4:55 AM, Nick Coghlan wrote:
> On Sun, May 19, 2013 at 4:41 PM, Raymond Hettinger
> wrote:
>> nicer repr" is worth "Sorry, I broke your tests, made your published
>> examples
>> out o
On Sun, May 19, 2013 at 4:41 PM, Raymond Hettinger
wrote:
> nicer repr" is worth "Sorry, I broke your tests, made your published
> examples
> out of date, and slowed down your code."
While the first two considerations are always potentially applicable
when using enums, the latter should only be t
On May 14, 2013, at 9:39 AM, Gregory P. Smith wrote:
> Bad: doctests.
I'm hoping that core developers don't get caught-up in the "doctests are bad
meme".
Instead, we should be clear about their primary purpose which is to test
the examples given in docstrings. In many cases, there is a gre
43 matches
Mail list logo