[Python-checkins] r82848 - python/branches/py3k/Doc/library/ast.rst

Ezio Melotti ezio.melotti at gmail.com
Tue Jul 13 19:17:55 CEST 2010


  On 13/07/2010 9.38, georg.brandl wrote:
> Author: georg.brandl
> Date: Tue Jul 13 08:38:10 2010
> New Revision: 82848
>
> Log:
> Add bytes in literal_eval doc.
>
> Modified:
>     python/branches/py3k/Doc/library/ast.rst
>
> Modified: python/branches/py3k/Doc/library/ast.rst
> ==============================================================================
> --- python/branches/py3k/Doc/library/ast.rst	(original)
> +++ python/branches/py3k/Doc/library/ast.rst	Tue Jul 13 08:38:10 2010
> @@ -119,14 +119,14 @@
>
>      Safely evaluate an expression node or a string containing a Python
>      expression.  The string or node provided may only consist of the following
> -   Python literal structures: strings, numbers, tuples, lists, dicts, sets,
> -   booleans, and ``None``.
> +   Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
> +   sets, booleans, and ``None``.
>
>      This can be used for safely evaluating strings containing Python expressions
>      from untrusted sources without the need to parse the values oneself.
>
>      .. versionchanged:: 3.2
> -      Now allows set literals.
> +      Now allows bytes and set literals.
>
>
>   .. function:: get_docstring(node, clean=True)
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>
This has been fixed in 3.1 too in r82829. As I said on IRC I consider 
this (and the missing set literals on 2.7/3.1) as a bug, so I would:
   1) remove the versionchanged from 3.2;
   2) add bytes literal in the doc for 3.1 (the fix has been backported 
already);
   3) backport and document set literals to 3.1 and 2.7 too;
   4) possibly update the doc for byte literals in 2.7 too (it just says 
'strings' but it supports u"" and b"" too).

(and if it can't be consider as a bug, the fix should probably be 
reverted from 3.1)


More information about the Python-checkins mailing list