This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alaniwi
Recipients alaniwi
Date 2020-07-19.10:03:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595153035.37.0.668957068395.issue41339@roundup.psfhosted.org>
In-reply-to
Content
It is possible to make `queue.Queue` and `queue.SimpleQueue` objects iterable by adding simple `__iter__` and `__next__` methods.  This is to suggest adding these methods to the existing `Queue` and `SimpleQueue` so that they are iterable by default.

```
class Fifo(SimpleQueue):

    def __iter__(self):
        return self

    def __next__(self):
        if not self.empty():
            return self.get()
        raise StopIteration
```
History
Date User Action Args
2020-07-19 10:03:55alaniwisetrecipients: + alaniwi
2020-07-19 10:03:55alaniwisetmessageid: <1595153035.37.0.668957068395.issue41339@roundup.psfhosted.org>
2020-07-19 10:03:55alaniwilinkissue41339 messages
2020-07-19 10:03:55alaniwicreate