[issue39158] ast.literal_eval() doesn't support empty sets

Serhiy Storchaka report at bugs.python.org
Sat Jan 4 08:41:21 EST 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

The documentation for ast.literal_eval():

   Safely evaluate an expression node or a string containing a Python literal or
   container display.  The string or node provided may only consist of the
   following Python literal structures: strings, bytes, numbers, tuples, lists,
   dicts, sets, booleans, and ``None``.

https://docs.python.org/3/library/ast.html#ast.literal_eval

If we are going to add support of a function call set(), we should change the documentation.

And if add support of non-literals, where should we stop? Should we support also frozenset() and bytearray()? inf and nan? infj and nanj? complex()? Ellipsis? __debug__?

----------
assignee:  -> docs at python
components: +Documentation -Library (Lib)
nosy: +docs at python
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39158>
_______________________________________


More information about the Python-bugs-list mailing list