Status of PEP's?

Samuele Pedroni pedronis at bluewin.ch
Thu Feb 28 02:47:35 CET 2002


Maybe this is a useful insight:

in mathematetics it is not uncommon to
identify the natural numbers with the set
of their predecessors

0 = {}
1 = {0} = {{}}
2 = {0, 1}  {{},{{}}}
etc

e.g. in the notation for power-sets

powerset(X) = 2^X  where 2 stands for
the set {0,1}

so having
  for i in 5
iterating over 0,1,2,3,4
is natural in mathematical sense
(which does not mean automatically that it is newbie friendly <wink>)

because 5 as an ordered set is the sequence (0,1,2,3,4)

so also the notation   1 in 5  is natural.

regards, Samuele Pedroni.





More information about the Python-list mailing list