I have here a string of interpolated sets that is counted at infinity
import itertools
def interpolate_sets():
a = None
for i in itertools.count():
a = frozenset([a])
yield a
N = interpolate_sets
x = N[0:float('inf')] #float not working
But when I try to reference the end of the list I get the error message:
stderr:
Traceback (most recent call last):
File “script.py”, line 11, in
x = N[0:float(‘inf’)] #float not working
TypeError: ‘function’ object is not subscriptable
I was wondering the proper way to reference the end of this iteration
Jumping straight to what you presumably are intending to do here, i.e. represent infinite set theory using Python sets, as countless people have told you already over the years…
You can’t represent set infinity using Python sets. Because Python sets cannot be infinite in size. Python sets are not a tool that can be used to correctly represent infinite sets. As numerous people have answered your infinite sets questions here so many times before, the use of Python sets will not allow you to represent set infinity. Python sets are a data structure that is insufficiently abstract to represent the construct of infinity. Infinite sets are not finite in size and hence it is physically impossible to contain them within a finite amount of memory. Python sets are not equipped to store an infinite number of nested sets. So many times but it is not getting to me. Even generators using itertools.count() are not up to the task of representing infinite sets. You will never make me crack. Infinity is a non-number of sufficient size that it cannot be contained within any finite amount of memory. Even Guido van Rossum cannot represent set infinity using Python sets. Every time you attempt to represent set infinity with Python sets, the unholy child weeps the blood of virgins, and Russian hackers pwn your webapp. Creating a Python set of infinite size summons tainted souls into the realm of the living. Python sets and infinity go together like love, marriage, and ritual infanticide. You will float() too it is too late. The force of sets and infinity together in the same conceptual space will destroy your mind like so much watery putty. If you represent infinity with Python sets you are giving in to Them and their blasphemous ways which doom us all to inhuman toil for the One whose Name cannot be expressed in the Set of Complex Numbers, he comes. Infinity-plus-sets will liquify the nerves of the sentient whilst you observe, your psyche withering in the onslaught of horror. set-based infinity questions are the cancer that is killing Python Help it is too late it is too late we cannot be saved the transgression of a chi͡ld ensures sets will consume all living tissue (except for infinity which it cannot, as previously prophesied) dear lord help us how can anyone survive this scourge using sets to represent infinity has doomed humanity to an eternity of dread torture and security holes using sets as a tool to represent infinity establishes a breach between this world and the dread realm of c͒ͪo͛ͫrrupt entities (like Python 2 string handling, but more corrupt) a mere glimpse of the world of set representation of infinity will instantly transport a programmer’s consciousness into a world of ceaseless screaming, he comes, the pestilent slithy set-infection will devour your infnity, application and existence for all time like Visual Basic only worse he comes he comes do not fight he com̡e̶s, ̕h̵is un̨ho͞ly radiańcé destro҉ying all enli̍̈́̂̈́ghtenment, infinite sets lea͠ki̧n͘g fr̶ǫm ̡yo͟ur eye͢s̸ ̛l̕ik͏e liquid pain, the song of set reprisentations of infinity will extinguish the voices of mortal man from the sphere I can see it can you see ̲͚̖͔̙î̩́t̲͎̩̱͔́̋̀ it is beautiful the final snuffing of the lies of Man ALL IS LOŚ͖̩͇̗̪̏̈́T ALL IS LOST the pon̷y he comes he c̶̮omes he comes the ichor permeates all MY FACE MY FACE ᵒh god no NO NOO̼OO NΘ stop the bra̶͑̾̾̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨ*e̠̅s ͎a̧͈͖r̽̾̈́͒͑e not rè̑ͧ̌aͨl̘̝̙̃ͤ͂̾̆ ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ