On 8/24/21 10:26 PM, Guido van Rossum wrote:
> On Tue, Aug 24, 2021 at 22:19 Christopher Barker wrote:
>> On Tue, Aug 24, 2021 at 9:58 PM David Mertz, Ph.D. wrote:

>>> Sorry, I should have been more explicit. The several kinds of queues can all
>>> "contain" items, but do not respond to len().
>>
>> yeah, I should have looked more closely at your list
>>
>> Though i would consider that an oversight, len(a_queue) could be handy.
>>
>> There is qsize() -- I wonder if there's a reason not to have __len__ do the 
same
>> thing --  O(n) maybe? See Guido's point that there's an assumption tha len() 
will
>> be O(1).
>
> What sort of code would be able to do anything useful with either a sequence 
or
> a queue? Queues aren’t iterable. This seems a case of hyper-generalization.

I don't think it's hyper-generalization of queues and sequences, but rather being consistent with the idea of something vs nothing. We can't iterate over integers, but not-zero numbers are still truthy.

--
~Ethan~
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/UAU4JGKER6QXSZDDDEPOJTOIVTNCSXVB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to