On 03 Jun 2012 16:20:11 GMT, Steven D'Aprano
wrote:
>And should I have known this from your initial post?
I did discuss the matter with Terry Reedy, actually, but I guess since
the newsgroup-to-mailing list mirror is one-way, there's no actual way
you could've known. :/ Sigh, another problem out
On Fri, 01 Jun 2012 20:24:30 -0700, Temia Eszteri wrote:
> On 02 Jun 2012 03:05:01 GMT, Steven D'Aprano
> wrote:
>
>>I doubt that very much. If you are using threads, it is more likely your
>>code has a race condition where you are modifying a weak set at the same
>>time another thread is trying
On 6/1/2012 7:40 PM, Temia Eszteri wrote:
Given that len(weakset) is defined (sensibly) as the number of currently
active members, it must count. weakset should really have .__bool__
method that uses any() instead of sum(). That might reduce, but not
necessarily eliminate your problem.
Think
On 02 Jun 2012 03:05:01 GMT, Steven D'Aprano
wrote:
>I doubt that very much. If you are using threads, it is more likely your
>code has a race condition where you are modifying a weak set at the same
>time another thread is trying to iterate over it (in this case, to
>determine it's length), a
On Fri, 01 Jun 2012 08:23:44 -0700, Temia Eszteri wrote:
> I've got a bit of a problem - my project uses weak sets in multiple
> areas, the problem case in particular being to indicate what objects are
> using a particular texture, if any, so that its priority in OpenGL can
> be adjusted to match
On Fri, 01 Jun 2012 18:42:22 -0400, Terry Reedy
wrote:
>I gather that the .references attribute is sometimes/always a weakset.
>To determine its boolean value, it computes its length. For regular
>sets, this is sensible as .__len__() returns a pre-computed value.
Indeed. Back when I
.Sprite("testbullet", 0)
File "C:\foo\bar\video.py", line 95, in __init__
self.opengl_id = reference_texture(self, target)
File "C:\foo\bar\video.py", line 310, in reference_texture
if not video_handler.textures[target].references:
I gather that the
I've got a bit of a problem - my project uses weak sets in multiple
areas, the problem case in particular being to indicate what objects
are using a particular texture, if any, so that its priority in OpenGL
can be adjusted to match at the same time as it being (de)referenced
by any explicit calls.
At Thursday 5/10/2006 13:53, [EMAIL PROTECTED] wrote:
Has anyone ever think about a set wich references its elements weakly ?
The *easy* solution would provide a WeakSet class with the following
behavior:
>>>s=set([a, b])
>>>ws=WeakSet([b,c])
>>>(ws&s).__cl
nterface for our needs.
class WeakSet(object):
"""A set of objects that doesn't keep its elements alive.
The objects in the set must be weakly referencable.
The objects need not be hashable, and need not support comparison.
Two objects are considered to be the sa
Hello,
Has anyone ever think about a set wich references its elements weakly ?
The *easy* solution would provide a WeakSet class with the following
behavior:
>>>s=set([a, b])
>>>ws=WeakSet([b,c])
>>>(ws&s).__class__() is WeakSet
True
>>>s&ws
TypeError:
11 matches
Mail list logo