From 16d3e04cb80a975eef0e0ad6f0f6dc4800860d3c Mon Sep 17 00:00:00 2001 From: Michael Fenn Date: Thu, 19 Mar 2015 15:10:44 -0400 Subject: compat: use eval instead of ast.literal_eval on python 2.4 --- doc/development/compat.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'doc') diff --git a/doc/development/compat.txt b/doc/development/compat.txt index 8700c46d3..5ac08ea68 100644 --- a/doc/development/compat.txt +++ b/doc/development/compat.txt @@ -129,6 +129,8 @@ below, since some of these implementations may be feature-incomplete. +----------------+--------------------------------+--------------------------------------------+ | MutableMapping | :class:`UserDict.DictMixin` | :class:`collections.MutableMapping` (2.6+) | +----------------+--------------------------------+--------------------------------------------+ +| literal_eval | :func:`ast.literal_eval` | :func:`eval` | ++----------------+--------------------------------+--------------------------------------------+ walk_packages ~~~~~~~~~~~~~ @@ -171,6 +173,14 @@ mind. :class:`collections.MutableMapping` is available in Python 2.6+, and will be used if available. +literal_eval +~~~~~~~~~~~~ + +:func:`ast.literal_eval` is a safe version of :func:`eval` that will only +allow delaration of literal strings, ints, list, dicts, etc. This was +introduced in Python 2.6, and as such Python 2.4 uses the plain-old +:func:`eval`. + Other Symbols ------------- -- cgit v1.2.3-1-g7c22