Re:Performance Analysis of Python's Dict() and {}
by shoo on Monday January 22, 2024 @03:30PM
(#39094991)
`{x, y}` is the set containing the two elements `x` and `y`, `{x}` is the set containing only the element `x`, so "surely `{}` is the empty set" !
[ Parent
| on HN ]
Re:Performance Analysis of Python's Dict() and {}
by pdonis on Monday January 22, 2024 @03:55PM
(#39095307)
If Python had had built-in set notation from the start, {} might indeed have been a notation for an empty set instead of an empty dict.
However, Python didn't even have sets at all until version 2.3, and they were in a stdlib module instead of being a built-in type until version 2.6. By that time dict notation was well entrenched.