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

Hrvoje Abraham report at bugs.python.org
Tue Nov 3 16:48:27 EST 2015


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 matter, maybe.

I know I can handle it as a special case, None for empty set, and close my eyes on fact that I lose None value reserved for some other cases. But this really is not a nice thing to do. Please reconsider...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24663>
_______________________________________


More information about the Python-bugs-list mailing list