← Back to context

Comment by kurtis_reed

2 days ago

{:} 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

  • There is a way to make it work. Python has no problem breaking things across major versions.

    • Python needed a breaking change for Unicode and a breaking change for exceptions and took it ages ago for a better future today - and it's still remembered as a huge PITA by everyone. I think you'll find everyone in the Python community disagreeing with you about a not-backwards-compatible Python 4.

      2 replies →

    • Are you suggesting to bump to Python 4 in order to be able to write `{}` instead of `set()` (or `{/}`) and simultaneously break all existing code using `{}` for dicts?

    • Breaking {} to be an empty set would be a HUGE breaking change, a _lot_ of code is already written where it is expected to be an empty dict. I don't think anyone in the Python committee would agree with breaking that