Iterate over text file, discarding some lines via context manager
Marko Rauhamaa
marko at pacujo.net
Fri Nov 28 13:04:49 EST 2014
More information about the Python-list mailing list
Fri Nov 28 13:04:49 EST 2014
- Previous message (by thread): Iterate over text file, discarding some lines via context manager
- Next message (by thread): Iterate over text file, discarding some lines via context manager
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Chris Angelico <rosuav at gmail.com>: > Since we're so good at it on this list, I will nit-pick: that's not a > context manager class, that's an iterator class. A context manager has > __enter__ and __exit__, an iterator has __iter__ (returning self) and > __next__ (returning or raising StopIteration). Excellent. Learnings will never end. Marko
- Previous message (by thread): Iterate over text file, discarding some lines via context manager
- Next message (by thread): Iterate over text file, discarding some lines via context manager
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list