<blockquote>
<p>Would a python iterator/generator can be considered a stream?</p>
</blockquote>
<p>No.</p>
<p>Basically, an iterator lazily traverses a sequence while a stream is a lazy sequence.</p>
<p>The difference between iterators and stream becomes clearer with the example you gave, an infinite sequence of natural numbers.</p>
<h2>Iterator</h2>
<p>This is a rather simplistic iterator, only with method <code>next()</code> implemented. This implementation is not iterable and does not conform with with python's <a href="https://docs.python.org/3/library/stdtypes.html#iterator-types" rel="nofollow noreferrer">iterator protocol</a>; however, it will make evident the differences with the stream implementation below.</p>
<pre><code>class Iterator:
     def __init__(self, state=1, compute=lambda x: x + 1):
         self.state = state
         self.compute = compute
     def next(self):
         current, self.state = self.state, self.compute(self.state)
         return current

natural_number = Iterator()
print(natural_number.next()) # 1
print(natural_number.next()) # 2
print(natural_number.next()) # 3
</code></pre>
<p>Every time <code>next()</code> is evoked, it returns the current element of the sequence and mutates the iterator's state.</p>
<h2>Stream</h2>
<p>Accordingly with SICP<a href="https://xuanji.appspot.com/isicp/3-5-streams.html" rel="nofollow noreferrer">2</a>, a stream can be defined by its first element, <code>car()</code>, and the rest of the stream, <code>cdr()</code>. In python, streams can be implemented as lazy linked lists constructed recursively.</p>
<pre><code>class Stream:
    def __init__(self, state=1, f=lambda x: x+1):
        self.state = state
        self.compute = f
    def car(self):
        return self.state
    def cdr(self):
        return Stream(self.compute(self.state), self.compute)

sequence_of_natural_numbers = Stream()      
sequence_of_natural_numbers.car()             # 1
sequence_of_natural_numbers.car()             # 1
sequence_of_natural_numbers.cdr().car()       # 2
sequence_of_natural_numbers.cdr().cdr().car() # 3
</code></pre>
<p>Whenever <code>car()</code> is evoked, it always returns the same element, the first element of the sequence. <code>crd()</code> returns a new <code>Stream</code> with the computed state. In this case the stream state is never mutated.</p>
<p>If you wonder if streams are useful, I would recommend you to read this paper <a href="https://arxiv.org/abs/2103.06913" rel="nofollow noreferrer">Classical (Co)Recursion: Programming</a>, which provides a practical implementation and some applications of streams.</p>
A iterator/generator can be considered a stream?
<p>I'm reading the SICP and ended up in the part of streams. </p>

<p>Would a python iterator/generator can be considered a stream?</p>

<p>This iterator for example:</p>

<pre><code>class MyNumbers:
  def __iter__(self):
    self.a = 1
    return self

  def __next__(self):
    x = self.a
    self.a += 1
    return x

myclass = MyNumbers()
myiter = iter(myclass)

print(next(myiter))
print(next(myiter))
print(next(myiter))
print(next(myiter))
print(next(myiter))

</code></pre>

<p>satisfies the definition: </p>

<blockquote>
  <p>a stream is a sequence of data elements made available over time. A stream can be thought of as items on a conveyor belt being processed one at a time rather than in large batches.</p>
</blockquote>

<p><a href="https://en.wikipedia.org/wiki/Stream_(computing)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Stream_(computing)</a></p>