On Fri, Apr 9, 2021 at 6:09 PM Stéfane Fermigier <[email protected]> wrote:
>
> I think the best alias for "empty set" would be the Unicode character "Empty 
> set" or U+2205, i.e. "∅".
>
> Alas, it's not a valid identifier in Python:
>
> >>> ∅ = set()
>   File "<stdin>", line 1
>     ∅ = set()
>     ^
> SyntaxError: invalid character '∅' (U+2205)
>
> It works with the similarly looking "ϕ" or 'GREEK PHI SYMBOL' (U+03D5)
>
> >>> ϕ = set()
> >>> ϕ.union({1,2})
> {1, 2}
>
> But it's less than ideal.
>
> I think it's an error from the Unicode standard to list the empty set as a 
> "Mathematical Operator" 
> (https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode#Mathematical_Operators_block)
>  and not as a
> "Letterlike Symbol" like ℝ or ℕ 
> (https://en.wikipedia.org/wiki/Mathematical_operators_and_symbols_in_Unicode#Letterlike_Symbols_block).
>
> Ex:
>
> >>> ℕ = [0, ...]  # Whatever that means...
> >>> ℕ
> [0, Ellipsis]
>
> So yes, the language would need to be changed to allow the proper empty set 
> unicode symbol to be used.
>

Not to mention everyone's keyboards. Python != APL. Err, I mean, Python ≠ APL.

ChrisA
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/TXKHZY6L3CE22XVK3MJTSW2LVGBOIBG5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to