[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-11-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3e8d3c4bc17e by Georg Brandl in branch '2.7': Closes #22525: clarify documentation for ast.literal_eval(). https://hg.python.org/cpython/rev/3e8d3c4bc17e -- ___ Python tracker

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-11-05 Thread Georg Brandl
Georg Brandl added the comment: Thanks, Raymond. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-11-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c5909740026 by Georg Brandl in branch '3.4': Closes #22525: clarify documentation for ast.literal_eval(). https://hg.python.org/cpython/rev/5c5909740026 -- nosy: +python-dev resolution: -> fixed stage: patch review -> resolved status: open

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-11-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Georg's proposed wording reads well and is clearer than the current wording. The patch is ready to apply. -- nosy: +rhettinger ___ Python tracker _

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-11-02 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> patch review type: -> enhancement ___ Python tracker ___ ___ Python-bugs-

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Georg Brandl
Georg Brandl added the comment: Sure, feel free to reword. An example or two might also be helpful. -- ___ Python tracker ___ ___ Pyt

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread R. David Murray
R. David Murray added the comment: It should probably also say "or a container display containing only literals". (That's a lot of "contain" :) (I had the same confusion the first time I read these docs, BTW). -- nosy: +r.david.murray ___ Python tr

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Behdad Esfahbod
Behdad Esfahbod added the comment: Thanks. In your proposed text: + Safely evaluate an expression node or a string containing a Python literal or container display. I suggest changing it to "...containing a single Python literal or..." Ie, adding "single". -- __

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Georg Brandl
Georg Brandl added the comment: The function is still called literal_eval(), not safe_eval(). I'm not saying a safe eval() isn't useful. But an implementation that is only partly safe is not going to help anyone. -- ___ Python tracker

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Georg Brandl
Georg Brandl added the comment: Attaching proposed doc change. -- keywords: +patch Added file: http://bugs.python.org/file36764/ast_literal_eval_clarify.patch ___ Python tracker

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Behdad Esfahbod
Behdad Esfahbod added the comment: I think it should be made much more clear that this is not a blanket "safe eval() replacement". Re complex literals, note that Python 2.7.x only implemented the binary plus operator if the second argument was complex. This seems to have been relaxed in Pyth

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Georg Brandl
Georg Brandl added the comment: I agree that the wording can be improved. The term "expression" is used here loosely, but should be clarified. "a+b" with numbers a, b must be handled in order to evaluate complex literals as in "1+1j". Allowing operator expressions with literals is possible,

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker ___ ___ Pyth

[issue22525] ast.literal_eval() doesn't do what the documentation says

2014-09-30 Thread Behdad Esfahbod
New submission from Behdad Esfahbod: The documentation says: """ 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, bytes, numbers, tuples, lists, dicts, sets, booleans