Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Steven D'Aprano
On 08/06/13 15:18, Stephen J. Turnbull wrote: Ethan Furman writes: > Enumerations can be pickled and unpickled:: > > >>> from enum import Enum > >>> class Fruit(Enum): > ... tomato = 1 > ... banana = 2 > ... cherry = 3 > ... > >>>

[Python-Dev] doctest and pickle

2013-06-07 Thread Stephen J. Turnbull
Ethan Furman writes: > Enumerations can be pickled and unpickled:: > > >>> from enum import Enum > >>> class Fruit(Enum): > ... tomato = 1 > ... banana = 2 > ... cherry = 3 > ... > >>> from pickle import dumps, loads > >>> Fruit.tomato

Re: [Python-Dev] [Python-checkins] cpython: Add reference implementation for PEP 443

2013-06-07 Thread PJ Eby
On Fri, Jun 7, 2013 at 5:16 PM, Łukasz Langa wrote: > On 7 cze 2013, at 22:50, PJ Eby wrote: > >> On Fri, Jun 7, 2013 at 10:27 AM, Thomas Wouters wrote: >>> This isn't a new bug, but it's exposed by always importing weakref and >>> atexit during interpreter startup. I'm wondering if that's reall

Re: [Python-Dev] [Python-checkins] cpython: Add reference implementation for PEP 443

2013-06-07 Thread Łukasz Langa
On 7 cze 2013, at 22:50, PJ Eby wrote: > On Fri, Jun 7, 2013 at 10:27 AM, Thomas Wouters wrote: >> This isn't a new bug, but it's exposed by always importing weakref and >> atexit during interpreter startup. I'm wondering if that's really necessary >> :) > > In short, the overall answer right n

Re: [Python-Dev] [Python-checkins] cpython: Add reference implementation for PEP 443

2013-06-07 Thread PJ Eby
On Fri, Jun 7, 2013 at 10:27 AM, Thomas Wouters wrote: > This isn't a new bug, but it's exposed by always importing weakref and > atexit during interpreter startup. I'm wondering if that's really necessary > :) Importing it during startup isn't necessary per se; imports needed only by the generic

Re: [Python-Dev] [Python-checkins] cpython: Add reference implementation for PEP 443

2013-06-07 Thread Łukasz Langa
On 7 cze 2013, at 16:27, Thomas Wouters wrote: > > On Wed, Jun 5, 2013 at 3:20 AM, lukasz.langa > wrote: > +from weakref import WeakKeyDictionary > > This isn't a new bug, but it's exposed by always importing weakref and atexit > during interpreter startup. I'm wondering if that's really ne

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Barry Warsaw
On Jun 07, 2013, at 02:30 PM, PJ Eby wrote: >I don't know if enums *actually* preserve this invariant, but my >default expectation of the One Obvious Way would be that enums, being >uniquely-named objects that know their name and container, should be >considered global objects in the same fashion

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Barry Warsaw
On Jun 07, 2013, at 09:06 AM, Ethan Furman wrote: >Oh, and I just realized this is probably why the flufl.enum docs import from >a preexisting module instead of creating a new class on the spot. Exactly. ;) -Barry ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Mark Janssen
>> Why are you using is here instead of ==? > > > I'm using `is` because I'm verifying that the instance returned by > `pickle.loads` is the exact same object as the instance fed into > `pickle.dumps`. Enum members should be singletons. I see now. That makes sense, but I don't think you'll be ab

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread PJ Eby
On Fri, Jun 7, 2013 at 1:54 PM, Mark Janssen wrote: > On Fri, Jun 7, 2013 at 10:50 AM, Mark Janssen > wrote: >>> >>> from pickle import dumps, loads >>> >>> Fruit.tomato is loads(dumps(Fruit.tomato)) >>> True >> >> Why are you using is here instead of ==? You're making a circular >>

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Ethan Furman
On 06/07/2013 10:54 AM, Mark Janssen wrote: On Fri, Jun 7, 2013 at 10:50 AM, Mark Janssen wrote: >>> from pickle import dumps, loads >>> Fruit.tomato is loads(dumps(Fruit.tomato)) True Why are you using is here instead of ==? You're making a circular loop using "is" I should

Re: [Python-Dev] [Python-checkins] cpython: Add reference implementation for PEP 443

2013-06-07 Thread Brett Cannon
On Fri, Jun 7, 2013 at 10:27 AM, Thomas Wouters wrote: > > On Wed, Jun 5, 2013 at 3:20 AM, lukasz.langa > wrote: > >> +from weakref import WeakKeyDictionary >> > > FYI, this change exposes a bug in the atexit module involving > subinterpreters, causing the refleaks reported by Antoine's daily re

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Ethan Furman
On 06/07/2013 10:50 AM, Mark Janssen wrote: >>> from pickle import dumps, loads >>> Fruit.tomato is loads(dumps(Fruit.tomato)) True Why are you using is here instead of ==? I'm using `is` because I'm verifying that the instance returned by `pickle.loads` is the exact same objec

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Ethan Furman
On 06/07/2013 09:54 AM, Olemis Lang wrote: On 6/7/13, Ethan Furman wrote: Is there a doctest mailing list? I couldn't find it. JFTR, Testing-in-Python (TiP) ML should be the right target for general purpose questions about testing, considering docs even for unittest and doctest http://lists

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread R. David Murray
On Fri, 07 Jun 2013 10:54:57 -0700, Mark Janssen wrote: > On Fri, Jun 7, 2013 at 10:50 AM, Mark Janssen > wrote: > >> >>> from pickle import dumps, loads > >> >>> Fruit.tomato is loads(dumps(Fruit.tomato)) > >> True > > > > Why are you using is here instead of ==? You're making a c

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Mark Janssen
On Fri, Jun 7, 2013 at 10:50 AM, Mark Janssen wrote: >> >>> from pickle import dumps, loads >> >>> Fruit.tomato is loads(dumps(Fruit.tomato)) >> True > > Why are you using is here instead of ==? You're making a circular > loop using "is" I should add that when you're serializing with

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Mark Janssen
> >>> from pickle import dumps, loads > >>> Fruit.tomato is loads(dumps(Fruit.tomato)) > True Why are you using is here instead of ==? You're making a circular loop using "is" -- MarkJ Tacoma, Washington ___ Python-Dev mailing list Python-D

Re: [Python-Dev] doctest and pickle

2013-06-07 Thread Olemis Lang
On 6/7/13, Ethan Furman wrote: > Is there a doctest mailing list? I couldn't find it. > JFTR, Testing-in-Python (TiP) ML should be the right target for general purpose questions about testing, considering docs even for unittest and doctest http://lists.idyll.org/listinfo/testing-in-python [...]

[Python-Dev] doctest and pickle

2013-06-07 Thread Ethan Furman
Is there a doctest mailing list? I couldn't find it. I'm try to use doctest to verify my docs (imagine that!) but I'm having trouble with the one that uses pickle (imagine that!). Any advice on how to make it work? Here's the excerpt: ===

[Python-Dev] Summary of Python tracker Issues

2013-06-07 Thread Python tracker
ACTIVITY SUMMARY (2013-05-31 - 2013-06-07) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open4024 (+27) closed 25905 (+21) total 29929 (+48) Open issues wit

[Python-Dev] html documentation and table-of-contents

2013-06-07 Thread Ethan Furman
I just used the build system on the 3.4.0 docs, and some of the library modules (haven't checked the others) have the TOC showing up at the bottom of the page instead of the top. Am I doing something wrong? -- ~Ethan~ ___ Python-Dev mailing list Pytho

Re: [Python-Dev] [Python-checkins] cpython: Issue #17931: Resolve confusion on Windows between pids and process handles.

2013-06-07 Thread Thomas Wouters
On Fri, Jun 7, 2013 at 5:16 PM, Brett Cannon wrote: > I think this CL introduced a memory leak. The daily leak report went from > 0 to not 0 between June 4 and June 5 and this is the only CL that touched C > code. > It wasn't introduced by C code :) The refleak report is induced by the PEP 443 i

Re: [Python-Dev] [Python-checkins] cpython: Issue #17931: Resolve confusion on Windows between pids and process handles.

2013-06-07 Thread Brett Cannon
I think this CL introduced a memory leak. The daily leak report went from 0 to not 0 between June 4 and June 5 and this is the only CL that touched C code. On Wed, Jun 5, 2013 at 6:31 PM, richard.oudkerk wrote: > http://hg.python.org/cpython/rev/0410bf251e10 > changeset: 84045:0410bf251e10 > u

Re: [Python-Dev] [Python-checkins] cpython: Add reference implementation for PEP 443

2013-06-07 Thread Thomas Wouters
On Wed, Jun 5, 2013 at 3:20 AM, lukasz.langa wrote: > +from weakref import WeakKeyDictionary > FYI, this change exposes a bug in the atexit module involving subinterpreters, causing the refleaks reported by Antoine's daily report: interpreter startup now always imports weakref, which imports atex