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.

Author zanella
Recipients benjamin.peterson, rhettinger, zanella
Date 2008-02-20.23:29:26
SpamBayes Score 0.00655126
Marked as misclassified No
Message-id <1203550168.06.0.554033269383.issue2149@psf.upfronthosting.co.za>
In-reply-to
Content
Firts: the security type was my error.

The method wich uses the maxsize:
"""
# Check whether the queue is full
def _full(self):
  return self.maxsize > 0 and len(self.queue) == self.maxsize
"""

@rhettinger: As per the documentation, negative values result on an
infinite Queue; well that AND will never be fulfilled with a negative
value anyway;

@gutworth: What I mean is that's "awkward", if you put an string for
example, it'll be the size of the string wich will be used on the
__cmp__ and on len(), but that's not explicit, or is it?

Example:

[zan@tails ~]$ python
Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class C:
...   def __init__(self): pass;
...
>>> c = C()
>>> import Queue
>>> a = Queue.Queue(c)
>>> len(c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: C instance has no attribute '__len__'
>>> a = Queue.Queue(c)
>>> a.put('q')
>>> a.get()
'q'
>>> a.put(1)
>>> a.put(2)
>>> a.put(3)
>>>
History
Date User Action Args
2008-02-20 23:29:28zanellasetspambayes_score: 0.00655126 -> 0.00655126
recipients: + zanella, rhettinger, benjamin.peterson
2008-02-20 23:29:28zanellasetspambayes_score: 0.00655126 -> 0.00655126
messageid: <1203550168.06.0.554033269383.issue2149@psf.upfronthosting.co.za>
2008-02-20 23:29:27zanellalinkissue2149 messages
2008-02-20 23:29:26zanellacreate