Comment by charlieyu1
2 days ago
More and more dubious things were designed in Python these days. A recent PEP purposes to use {/} as the empty set
2 days ago
More and more dubious things were designed in Python these days. A recent PEP purposes to use {/} as the empty set
Problem is, we already have a syntax for empty lists [], empty tuples (), and {} is taken for an empty dict. So having a syntax for an empty set actually makes sense to me
{:} should have been the empty dict, now there's no good solution
I agree that {:} would be a better empty expression for dicts, but that ship has already sailed. {/} looks like a good enough alternative
7 replies →
Making sense, and being good, is not necessary the same.
Yes, having a solution for this makes sense, but the proposed solutions are just not good. Sometimes one has to admit that not everything can be solved gracefully and just stop, hunting the whale.
You can use “set()”. Introducing more weird special cases into the language is a bad direction for Python.
And you can use dict() for an empty dictionary, and list() for an empty list.
10 replies →
No no no, it's a great direction towards becoming the new Perl.
Idk that doesn’t sound so dubious to me. ∅ might be more approachable for the PHDs then set() ;)
we all love non ascii code (cough emoji variable names)