Claudiu Popa added the comment:
I believe that returning a TypeError instead of a ValueError is better in this
situation. Technically, passing 'a' as maxlen makes that value inappropiate,
thus the use of TypeError. It will also be backward compatible. Also, your
patch needs test updates.
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19768
___
___
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
priority: normal - low
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19768
___
___
Raymond Hettinger added the comment:
Sorry, but I don't find this to be an improvement and don't think there is a
real problem worth fixing.
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
New submission from Vajrasky Kok:
from collections import deque
deque('abc', maxlen='a')
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: an integer is required
But it's a lie. You can give None to maxlen
deque('abc', maxlen=None)
deque(['a', 'b', 'c'])
maxlen