Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/library/shelve.rst

    r2 r391  
    77
    88.. index:: module: pickle
     9
     10**Source code:** :source:`Lib/shelve.py`
     11
     12--------------
    913
    1014A "shelf" is a persistent, dictionary-like object.  The difference with "dbm"
     
    1519
    1620
    17 .. function:: open(filename[, flag='c'[, protocol=None[, writeback=False]]])
     21.. function:: open(filename, flag='c', protocol=None, writeback=False)
    1822
    1923   Open a persistent dictionary.  The filename specified is the base filename for
     
    4145   mutated).
    4246
    43    .. note::
    44 
    45       Do not rely on the shelf being closed automatically; always call
    46       :meth:`close` explicitly when you don't need it any more, or use a
    47       :keyword:`with` statement with :func:`contextlib.closing`.
    48 
     47   Like file objects, shelve objects should be closed explicitly to ensure
     48   that the persistent data is flushed to disk.
     49
     50.. warning::
     51
     52   Because the :mod:`shelve` module is backed by :mod:`pickle`, it is insecure
     53   to load a shelf from an untrusted source.  Like with pickle, loading a shelf
     54   can execute arbitrary code.
    4955
    5056Shelf objects support all methods supported by dictionaries.  This eases the
     
    97103
    98104
    99 .. class:: Shelf(dict[, protocol=None[, writeback=False]])
     105.. class:: Shelf(dict, protocol=None, writeback=False)
    100106
    101107   A subclass of :class:`UserDict.DictMixin` which stores pickled values in the
     
    115121
    116122
    117 .. class:: BsdDbShelf(dict[, protocol=None[, writeback=False]])
     123.. class:: BsdDbShelf(dict, protocol=None, writeback=False)
    118124
    119125   A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`,
     
    126132
    127133
    128 .. class:: DbfilenameShelf(filename[, flag='c'[, protocol=None[, writeback=False]]])
     134.. class:: DbfilenameShelf(filename, flag='c', protocol=None, writeback=False)
    129135
    130136   A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-like
Note: See TracChangeset for help on using the changeset viewer.