5 ms·
My problem with {} is that the syntax for dicts {x1:y1, x2:y2 ...} and sets {x1, x2 ...} Are very close, and {} is slightly ambiguous. I've run into bugs beca
by nephanth 3y ago
My problem with {} is that the syntax for dicts
{x1:y1, x2:y2 ...}
and sets {x1, x2 ...}
Are very close, and {} is slightly ambiguous.
I've run into bugs because i wrote {} for the empty set. Since then i write dict() and set()
- xarope 3y ago+1. I've run into this too, and ended up using set() to clarify.
- dr_kiszonka 3y agoYou could write, e.g., `flags: set = {}` to get both speed and readability.