New submission from Edd: Hi,
I am willing to bet that this has been discussed before, but I don't see any related bugs. I have been using Python for a while now as a prototyping language for scientific applications. Most recently I have been using it for prototype program analyses. In this kind of work you are usually transcribing pseudo-code, defined in terms of sets, vectors and mappings into Python syntax. Inevitably, you need to store sets of sets, or you need to do some other operation that requires a hashable data structure. As a result, I never use sets. I usually resort to using frozensets, which are hashable, yet the syntax for creating these is very verbose: frozenset([e1, e2, ...]) To counter this, I usually use the following hack: fs = frozenset then frozensets can be instantiated like this: fs([e1, e2, ...]) But this is not ideal. I can't help wondering why there is not a frozenset literal. I see that the mutable set recently got a literal, but why not frozenset? Cheers! ---------- components: Interpreter Core messages: 186486 nosy: vext01 priority: normal severity: normal status: open title: Frozenset literal? type: enhancement _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17685> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com