[issue24663] ast.literal_eval does not handle empty set literals

2016-02-27 Thread yota moteuchi
yota moteuchi added the comment: Well, I would disagree with R. David Murray on this. literal_eval() is meant to safely parse literal pythons "containers" structures. {1, 2, 3} is a valid literal set(), why would an empty one not be parse-able as well. I can not predict, when I dump the

[issue24663] ast.literal_eval does not handle empty set literals

2015-11-03 Thread R. David Murray
R. David Murray added the comment: Like I said, you should take your use case to python-ideas, for a safe_eval that would handle it. literal_eval is not the place for handing 'set()', in my opinion. (There is always a chance other other devs will disagree, but none have so far :). FYI,

[issue24663] ast.literal_eval does not handle empty set literals

2015-11-03 Thread Hrvoje Abraham
Hrvoje Abraham added the comment: For now I'll implement my_literal_eval via AST filtering, reproducing ast.literal_eval + 'set()' functionality. -- ___ Python tracker

[issue24663] ast.literal_eval does not handle empty set literals

2015-11-03 Thread Hrvoje Abraham
Hrvoje Abraham added the comment: I use communication protocol based on Python literals and ast.literal_eval for deserialization. I'm avoiding sets because empty set value is not supported in a clean consistent manner on language level. If I write repr(set()) i get 'set()', this should

[issue24663] ast.literal_eval does not handle empty set literals

2015-11-03 Thread Hrvoje Abraham
Hrvoje Abraham added the comment: I believe this is the issue. ast.literal_eval sets support can not be considered complete until it also handles empty sets. I do not consider it valid for me to explicitly handle this case in my projects using some weird hacks. Python community settled on

[issue24663] ast.literal_eval does not handle empty set literals

2015-11-03 Thread R. David Murray
R. David Murray added the comment: You haven't presented an actual use case, it would be interesting to see one. Regardless of that, however, ast.literal_eval is an exposure of the literal value parsing part of the AST. set() is not part of that, because it is not a literal, it is a function

[issue24663] ast.literal_eval does not handle empty set literals

2015-07-18 Thread Ezio Melotti
Ezio Melotti added the comment: I believe this is by design, since set() -- like str(), list(), dict(), etc -- is not a literal. I don't think set() should be special-cased either. Perhaps you could tell us more about your use case? -- nosy: +ezio.melotti resolution: - not a bug

[issue24663] ast.literal_eval does not handle empty set literals

2015-07-18 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24663 ___ ___ Python-bugs-list

[issue24663] ast.literal_eval does not handle empty set literals

2015-07-18 Thread Filip Haglund
Filip Haglund added the comment: Okey, then this is not a bug. I can just handle this special case myself. Thanks! -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24663