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:

===============================================================================
Pickling
--------

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 is loads(dumps(Fruit.tomato))
    True

The usual restrictions for pickling apply: picklable enums must be defined in
the top level of a module, since unpickling requires them to be importable
from that module.
===============================================================================

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. Still, it would be nice if this could work.

Any ideas?

--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to