[Python-Dev] PEP 276 (simple iterator for ints)

Gareth McCaughan gmccaughan at synaptics-uk.com
Thu Jul 1 04:01:39 EDT 2004


On Thursday 2004-07-01 03:17, Greg Ewing wrote:

> I suspect most people other than number theorists would
> find the concept of a set of integers being contained
> in another integer quite wierd.

<pedant type="mathematician">
Actually, most number theorists would too. It's only
set theorists to whom that seems like a natural definition.
And the first (so far as I know) attempt to define the
natural numbers set-theoretically did it quite differently:
Gottlob Frege proposed to define n as the set of all
sets of size n. Unfortunately, Frege's version of set
theory famously didn't work (it was demolished by Russell's
paradox) and his construction doesn't work in ZF set theory,
which is what most set theorists use nowadays.

In any case, saying that (e.g.) 3 is a member of 17
is generally regarded as an implementation detail.
Mathematicians understand the different between interface
and implementation just about as well as software people.
(Which is to say: some understand it very well, and others
don't.)

By the by, I don't think it's true that sets.Set(42)
would, under PEP276, be the usual implementation of 42
in set theory. It would be a set whose elements are
ordinary Python integers, which are not themselves sets.
If you see what I mean. :-)
</pedant>

-- 
g





More information about the Python-Dev mailing list