Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

Re: [Python-checkins] cpython (3.2): zip() returns an iterator, make a list() of it; thanks to Martin from docs@

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


chris.jerdonek at gmail

Aug 12, 2012, 5:40 AM

Post #1 of 5 (440 views)
Permalink
Re: [Python-checkins] cpython (3.2): zip() returns an iterator, make a list() of it; thanks to Martin from docs@

On Sun, Aug 12, 2012 at 1:25 AM, sandro.tosi <python-checkins [at] python> wrote:
> http://hg.python.org/cpython/rev/233673503217
> changeset: 78512:233673503217
> user: Sandro Tosi <sandro.tosi [at] gmail>
> date: Sun Aug 12 10:24:50 2012 +0200
> summary:
> zip() returns an iterator, make a list() of it; thanks to Martin from docs@

> diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
> - >>> zip(*matrix)
> + >>> list(zip(*matrix))
> [.(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]

Is there a reason we don't run the doctests in the Doc/ folder's .rst
files as part of regrtest (e.g. via DocFileSuite), or is that
something we just haven't gotten around to doing?

--Chris
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


andrew.svetlov at gmail

Aug 12, 2012, 6:00 AM

Post #2 of 5 (404 views)
Permalink
Re: [Python-checkins] cpython (3.2): zip() returns an iterator, make a list() of it; thanks to Martin from docs@ [In reply to]

Just now doctest-like code blocks in Doc/* are used for two different targets:
1. regular doctests
2. notation for documentation
While former can be tested the later will definitely fail (missing
variables, functions, files etc.)

Also docs contains mixed notation, when, say, function declared as
regular code block than called from doctest (see functools.lru_cache
examples). Doctest obviously failed because it cannot find function.

For now if you will try to run doctest on Doc/**.rst you will get *a
lot* of failures.

I doubt if we will convert all docs to pass doctests, at least quickly.
Also making docs doctest-safe sometimes requires less clean and worse
readable notation.

On Sun, Aug 12, 2012 at 3:40 PM, Chris Jerdonek
<chris.jerdonek [at] gmail> wrote:
> On Sun, Aug 12, 2012 at 1:25 AM, sandro.tosi <python-checkins [at] python> wrote:
>> http://hg.python.org/cpython/rev/233673503217
>> changeset: 78512:233673503217
>> user: Sandro Tosi <sandro.tosi [at] gmail>
>> date: Sun Aug 12 10:24:50 2012 +0200
>> summary:
>> zip() returns an iterator, make a list() of it; thanks to Martin from docs@
>
>> diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
>> - >>> zip(*matrix)
>> + >>> list(zip(*matrix))
>> [.(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]
>
> Is there a reason we don't run the doctests in the Doc/ folder's .rst
> files as part of regrtest (e.g. via DocFileSuite), or is that
> something we just haven't gotten around to doing?
>
> --Chris
> _______________________________________________
> Python-Dev mailing list
> Python-Dev [at] python
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/andrew.svetlov%40gmail.com



--
Thanks,
Andrew Svetlov
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ncoghlan at gmail

Aug 12, 2012, 6:37 AM

Post #3 of 5 (401 views)
Permalink
Re: [Python-checkins] cpython (3.2): zip() returns an iterator, make a list() of it; thanks to Martin from docs@ [In reply to]

On Sun, Aug 12, 2012 at 11:00 PM, Andrew Svetlov
<andrew.svetlov [at] gmail> wrote:
> I doubt if we will convert all docs to pass doctests, at least quickly.
> Also making docs doctest-safe sometimes requires less clean and worse
> readable notation.

About the only thing that could work in a reasonable way is a doctest
mode for 3.4 where it could be told to ignore files unless they
contained some kind of "doctest-safe" marker.

Cheers,
Nick.

--
Nick Coghlan | ncoghlan [at] gmail | Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


andrew.svetlov at gmail

Aug 12, 2012, 6:40 AM

Post #4 of 5 (398 views)
Permalink
Re: [Python-checkins] cpython (3.2): zip() returns an iterator, make a list() of it; thanks to Martin from docs@ [In reply to]

Sounds good.

On Sun, Aug 12, 2012 at 4:37 PM, Nick Coghlan <ncoghlan [at] gmail> wrote:
> On Sun, Aug 12, 2012 at 11:00 PM, Andrew Svetlov
> <andrew.svetlov [at] gmail> wrote:
>> I doubt if we will convert all docs to pass doctests, at least quickly.
>> Also making docs doctest-safe sometimes requires less clean and worse
>> readable notation.
>
> About the only thing that could work in a reasonable way is a doctest
> mode for 3.4 where it could be told to ignore files unless they
> contained some kind of "doctest-safe" marker.
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan | ncoghlan [at] gmail | Brisbane, Australia



--
Thanks,
Andrew Svetlov
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


chris.jerdonek at gmail

Aug 12, 2012, 7:01 AM

Post #5 of 5 (396 views)
Permalink
Re: [Python-checkins] cpython (3.2): zip() returns an iterator, make a list() of it; thanks to Martin from docs@ [In reply to]

On Sun, Aug 12, 2012 at 6:37 AM, Nick Coghlan <ncoghlan [at] gmail> wrote:
> On Sun, Aug 12, 2012 at 11:00 PM, Andrew Svetlov
> <andrew.svetlov [at] gmail> wrote:
>> I doubt if we will convert all docs to pass doctests, at least quickly.
>> Also making docs doctest-safe sometimes requires less clean and worse
>> readable notation.
>
> About the only thing that could work in a reasonable way is a doctest
> mode for 3.4 where it could be told to ignore files unless they
> contained some kind of "doctest-safe" marker.

I created an issue for this here:

http://bugs.python.org/issue15629

--Chris
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.