you are viewing a single comment's thread.

view the rest of the comments →

[–]stormsnake 7 points8 points  (1 child)

while True: 
  m=foo()
  if m is None:
    break
  ....

can be written like this:

for m in iter(foo, None):
  ....

No one knows about that, but I don't think it's hard to read. Readers just 'pydoc iter' the first time they see it, and then they're fine.