title: Is `iter(callable, sentinel)` still Pythonic?
body: <p>The second argument of the <code>iter</code> function is useful for <a href="https://stackoverflow.com/q/38087427/205521">looping over objects that don't define themselves as iterable</a>, such as binary files:</p>
  
  <pre><code>response = b''
  for block in iter(partial(f.read, 256), b''):
      response += block
  </code></pre>
  
  <p>However in Python 3.8 we now have the “the walrus operator”, which in the <a href="https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions" rel="nofollow noreferrer">What's new in Python 3.8</a> article is mentioned as way to solve the exact problem above:</p>
  
  <pre><code># Loop over fixed length blocks
  while (block := f.read(256)) != '':
      process(block)
  </code></pre>
  
  <p>I wonder if the later is now considered "the right approach"? And if so, if there is ever any need for the second argument of <code>iter</code>, since any code on the form</p>
  
  <pre><code>for x in iter(f, y):
      g(x)
  </code></pre>
  
  <p>might as well now be written:</p>
  
  <pre><code>while (x := f()) != y:
      g(x)
  </code></pre>
  
  <p>I guess there might still be cases where we don't want to immediately loop the iterable, such as <code>b''.join(iter(partial(f.read, 256), b''))</code> or some code (though it quickly gets pretty hairy).
  Also a loop like <code>for i, x in enumerate(iter(f, y)):</code> might be hard to translate to the new syntax(?)</p>
  
  <p><a href="https://www.python.org/dev/peps/pep-0572/" rel="nofollow noreferrer">The PEP</a> for walrus only mentions 2-arg <code>iter</code> in the example <code>while h(x := f()): g(x)</code>, which it says can't trivially be translated to <code>iter</code>.</p>
  
  <p>Python usually have pretty precise guidelines on these sorts of things, but I haven't been able to find any for this particular issue. Can you help me?</p>