[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] BUG: The behavior of the Group.has method vs. its documentation



I suggest that Group.has() and Group.has([]) should always return True. Consider the behavior of Python's built-in set type:

>>> set1 = set((0, 1, 2, 3))
>>> set2 = set(())
>>> set1.issuperset(set2)
True

>>> set1 = set(())
>>> set2 = set(())
>>> set1.issuperset(set2)
True

Jason

----- Original Message ----
From: "don@xxxxxxxxxxxxxxxxx" <don@xxxxxxxxxxxxxxxxx>
To: pygame-users@xxxxxxxx
Sent: Mon, February 1, 2010 5:54:31 AM
Subject: Re: [pygame] BUG: The behavior of the Group.has method vs. its documentation

But the current behavior seems to be inconsistent, i.e. it depends on the
order of the sprites. 
Compare the two last examples Jason provided.
Too me, that seems to be a bug.
I also just realized an interesting behavior:

>>> grp1.has()
None

shouldn't that either raise an exception or return True like grp1.has([])
does?

//Lorenz