Author xtreak
Recipients porton, rhettinger, xtreak
Date 2018-07-21.16:18:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Relevant SO answer :

Ref :

> If a class defines neither __len__() nor __bool__(), all its instances are considered true.

I don't know why it's not implemented and the SO answer comments has some discussion. Maybe this can be clarified in the doc.

➜  cpython git:(master) rlwrap ./python
Python 3.8.0a0 (heads/master:56868f9, Jul 21 2018, 14:28:31)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from queue import PriorityQueue
>>> len(PriorityQueue([1]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object of type 'PriorityQueue' has no len()

Date User Action Args
2018-07-21 16:18:16xtreaksetrecipients: + xtreak, rhettinger, porton
2018-07-21 16:18:16xtreaksetmessageid: <>
2018-07-21 16:18:16xtreaklinkissue34180 messages
2018-07-21 16:18:16xtreakcreate