There is a currently undocumented functionality of Rect.__contains__ where one can check if another rect is completely contained inside the rect, the same functionality provided by the original Rect.contains() method.
Added by pygame/pygame#2897.
I saw this from #3531 (comment).
The __contains__ magic method is mainly intended for checking if an item is an element of a collection. Overloading it with other functionality for syntactic sugar is not necessary and a bit confusing.
So, I think this functionality should be removed from __contains__.
This affects #3877, which adds a small docstring to __contains__ referencing this behavior (though it does not appear in the generated API reference).
There is a currently undocumented functionality of
Rect.__contains__where one can check if another rect is completely contained inside the rect, the same functionality provided by the originalRect.contains()method.Added by pygame/pygame#2897.
I saw this from #3531 (comment).
The
__contains__magic method is mainly intended for checking if an item is an element of a collection. Overloading it with other functionality for syntactic sugar is not necessary and a bit confusing.So, I think this functionality should be removed from
__contains__.This affects #3877, which adds a small docstring to
__contains__referencing this behavior (though it does not appear in the generated API reference).