while (a=b()) ... infinite sets digression

Chad Netzer chad at vision.arc.nasa.gov
Sun May 16 15:29:24 EDT 1999


Jim Meier wrote:

> William Tanksley wrote:
>
> > On Sat, 15 May 1999 18:41:26 GMT, Jim Meier wrote:
> >
> > >The subset of infinity that does not start with an underscore is exactly 50%.
> > >(every item that does, has a corresponding item that doesn't.)
> >
> > I don't think so -- what the symbol which pairs with "_" or "__"?
>
> ??? I don't understand what you are saying here, but I'll explain what I mean more
> clearly.
>
> First of all, I was making a joke. Really. :)

Okay, consider this friendly musings on your original statement. :-)

>
> If you have one thing, you can prepend a "_" to it. So for every element that
> doesn't begin with "_" there is another that does.

William was just saying that for EACH string (of some finite or infinite length)
that does NOT start with an underscore, you can find that string with one or more
underscores prepended.  ie. for each string "A" that does not start with an
underscore, there are infinitely many that start with one or more underscores:

_A
__A
___A
etc...

 So, there are infinitely more strings which start with underscores than do not, and
the percentage of all possible strings that do not start with underscores, is (in the
limit) 0%.  Of course, "from spam import *" will safely ignore all those possibilities,
thus you can generally avoid those hard-to-type-infinitely-long-strings-with-
arbitrarily-long-sequences-of-underscores-prepended identifiers in most Python
programming. :-)

Chad Netzer
chad at vision.arc.nasa.gov








More information about the Python-list mailing list