New submission from Robin: > Finally, urllib/robotparser.py appears to contain a bug in the > following: > > req_rate = collections.namedtuple('req_rate', > 'requests seconds') > entry.req_rate = req_rate > entry.req_rate.requests = int(numbers[0]) > entry.req_rate.seconds = int(numbers[1]) > > As I read it, this should fail as the req_rate is immutable.
Ref: https://news.ycombinator.com/item?id=15136961 They are mistaken in the nature of the bug, which is that req_rate is a namedtuple type, rather than an instance. As such, it is actually mutable, causing the assignments to not fail. Every entry creates a separate req_rate type, so it all works, but not in the way it should. ---------- components: Library (Lib) messages: 301127 nosy: gvx priority: normal pull_requests: 3307 severity: normal status: open title: req_rate is a namedtuple type rather than instance type: behavior versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31325> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com