while (a=b()) ... infinite sets digression
Michael P. Reilly
arcege at shore.net
Wed May 19 10:43:44 EDT 1999
Gordon McMillan <gmcm at hypernet.com> wrote:
: Greg Ewing wrote:
:> Chad Netzer wrote:
:> >
:> > So, there are infinitely more strings which start with underscores than do not,
:>
:> Hmmm... this would seem to imply that there are
:> infinitely many more strings starting with any
:> given character than any other character.
:>
:> Which seems absurd. Although where infinities
:> are involved, that doesn't necessarily mean it's
:> not true...
:>
:> Tricky and dangerous beasts, these infinities!
: Unfortunately, Chad mispoke. For any string beginning with an
: underscrore there are (num_possible_characters-1) strings not
: beginning with an underscore (just replace that first character).
: But if there are Aleph-nought strings beginning with underscore,
: there are N*Aleph-nought == Aleph-nought not beginning with
: underscore.
: Chad's trickery is in trying to get you to assume that Aleph-nough
: minus Aleph-nought is 0. Nice try.
Next he'll try to convince us that aleph-null == C, right?
: All this assumes, of course, that you allow strings of infinte
: length. Personally, I don't. And since strings don't have sides, you
: can't even fake one by folding a finite-lengthed one into a Mobius
: string.
Turing allowed them. ;) But you can also create a universe with a
metric defined such that a string of any number of characters still
yields a length of infinity.
class IString:
def __init__(self, chars):
self.value = chars
def __len__(self):
# problem is defining aleph_null as a PyIntObject
return aleph_null
def __getitem__(self, index):
"""Repeat the contents, ad nauseum, just as an example."""
return self.value[index%len(self.value)]
-Arcege
More information about the Python-list
mailing list