infinite_seq

class narupatools.util.collections.infinite_seq(value: _T)

Represents an (infinitely long) sequence of the same value.

This is similar to itertools.repeat, except it also returns the value when called using index notation.

seq = infinite_seq("my_string")

seq[242]  # returns "my_string"

Inheritance

Inheritance diagram of infinite_seq

Methods

__init__

Initialize self.

__init__(value: _T)

Initialize self. See help(type(self)) for accurate signature.