New submission from Vedran Čačić <ved...@gmail.com>:

Look at this:

>>> import bisect
>>> bisect.bisect({}, None)
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    bisect.bisect({}, None)
TypeError: object of type 'dict' has no len()

Of course, objects of type 'dict' do have len. The problem is that bisect 
considers its first argument a sequence, which is very sensible to do 
(although, with ordered dicts, it's not the only sensible choice), but it gives 
a very wrong error message given that context.

At https://bugs.python.org/issue32500, R. David Murray told me to open this.

----------
components: Interpreter Core
messages: 320178
nosy: veky
priority: normal
severity: normal
status: open
title: Error message says dict has no len
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33933>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to