Message 339340 - Python tracker

Message339340

Author george-shuklin
Recipients george-shuklin
Date 2019-04-02.14:57:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1554217053.66.0.153832403851.issue36507@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-04-02 14:57:33george-shuklinsetrecipients: + george-shuklin
2019-04-02 14:57:33george-shuklinsetmessageid: <1554217053.66.0.153832403851.issue36507@roundup.psfhosted.org>
2019-04-02 14:57:33george-shuklinlinkissue36507 messages
2019-04-02 14:57:33george-shuklincreate