[issue19768] Not so correct error message when giving incorrect type to maxlen in deque

2014-06-14 Thread Claudiu Popa
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.

[issue19768] Not so correct error message when giving incorrect type to maxlen in deque

2014-06-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19768 ___ ___

[issue19768] Not so correct error message when giving incorrect type to maxlen in deque

2014-06-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19768 ___ ___

[issue19768] Not so correct error message when giving incorrect type to maxlen in deque

2014-06-14 Thread Raymond Hettinger
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

[issue19768] Not so correct error message when giving incorrect type to maxlen in deque

2013-11-25 Thread Vajrasky Kok
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