New submission from George Shuklin <george.shuk...@gmail.com>:
ZFC (https://en.wikipedia.org/wiki/Zermelo%E2%80%93Fraenkel_set_theory) defines numbers as nested empty sets. 0 is {} 1 is {{}} 2 is {{{}}} Sets can not be nested in python (as they are mutable), so next best type is frozen set. Unfortunately, nested sets are equal to each other no matter how deep they are nested. This behavior means that 3==2, and it breaks all set operations for ZFC. Minimal example: frozenset({frozenset()}) >>> x=frozenset() >>> y=frozenset(frozenset()) >>> x is y True ---------- components: Interpreter Core messages: 339340 nosy: george-shuklin priority: normal severity: normal status: open title: frozenset type breaks ZFC type: behavior versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36507> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com