PEP 218 Re: ANN: set-0.1 module available
Roman Suzi
rnd at onego.ru
Sat May 18 01:46:31 EDT 2002
On Fri, 17 May 2002, James J. Besemer wrote:
> Fernando PИrez wrote:
>
> > I beg to differ. Mathematically, there's nothing in the idea of a set that
> > makes it immutable. I know that Python is not a mathematics-only language,
> > but much of the cleanliness of its design does come from following abstract
> > ideas as much as is reasonable. And enforcing immutability on a set is one
> > hell of a breakage for an object as basic to many mathematical ideas as a set
> > is.
>
> I beg to differ. Mathematically, there's no notion of assignment like we have in
> programming. From a traditional mathematics view " x = x + 1" is a nonsensical
> statement. At best it's a contradiction in terms. In Mathematics, you don't
> have assignment that can be done over and over. You can only make statements
> about equality or inequality. At bottom all mathematics is defined in terms of
> sets and predicates about sets.
It is right. But if you look into applied math journals, people
communicate algorithms in a pseudolanguage where sets are
widely used. It could be nice if Python supported such things closer.
> In the context of mathematics I would argue that ALL objects are
> immutable. When you say "2 + 3 = 5", the 2 and the 3 don't cease to
> exist. Numbers are immutable. Similarly, when you say B union C you
> are defining a third, new set, composed of the union of the first two.
> The first two don't go away. They continue to exist (necessarily) to
> maintain the definition of the result. You don't destroy or reuse the
> previous ones.
Sincerely yours, Roman A.Suzi
--
- Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
More information about the Python-list
mailing list