augusto-moura 3 days ago

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

  • kurtis_reed 3 days ago

    {:} should have been the empty dict, now there's no good solution

    • augusto-moura 3 days ago

      I agree that {:} would be a better empty expression for dicts, but that ship has already sailed. {/} looks like a good enough alternative

      • sitkack 3 days ago

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

  • slightwinder 3 days ago

    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.

  • rand_r 3 days ago

    You can use “set()”. Introducing more weird special cases into the language is a bad direction for Python.

    • thayne 3 days ago

      And you can use dict() for an empty dictionary, and list() for an empty list.

      • mrguyorama 2 days ago

        For reasons I don't think I understand, using the functions is "discouraged" because "someone might muck with how those functions work" and the python world, in it's perfect wisdom responded "Oh of course" instead of "That's so damn stupid, don't do that because it would be surprising to people who expect built in functions to do built in logic"

    • tpm 3 days ago

      No no no, it's a great direction towards becoming the new Perl.

umgefahren 3 days ago

Idk that doesn’t sound so dubious to me. ∅ might be more approachable for the PHDs then set() ;)

  • rtrgrd 3 days ago

    we all love non ascii code (cough emoji variable names)