This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Queue.qsize() better info about unreliability
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: nkour, rhettinger
Priority: normal Keywords:

Created on 2005-06-02 12:56 by nkour, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg25475 - (view) Author: Nikos Kouremenos (nkour) Date: 2005-06-02 12:56
I know Queues are supposed to be used mostly in threads
apps.
since they are not banned to apps without threads, I
think that

     |  qsize(self)
     |      Return the approximate size of the queue
(not reliable!).

can be better.
You mean not reliable (or unreliable :D) because of
threads right?

if you mean *GENERALLY* because of when ti goes to next
instruction it might have change, then put this not
reliable thing in len() too ;)

I propose:
(urreliable if using threads)
msg25476 - (view) Author: Nikos Kouremenos (nkour) Date: 2005-06-02 13:02
Logged In: YES 
user_id=865368

or better:

qsize() :: "Return the approximate size of the queue.
Because of multithreading semantics, this number is not
reliable." (RexxFi)
msg25477 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-06-14 08:52
Logged In: YES 
user_id=80475

In Py2.4.1, the wording is already:
   Because of multithreading semantics, this number is not
reliable.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 42046
2005-06-02 12:56:44nkourcreate