Skip to content

Incorrect contains error message in FRect #3533

@Starbuck5

Description

@Starbuck5

I was looking at the relevant code for @Hato1's proposal in #3531 and I noticed that FRects and Rects have the same error message.

>>> import pygame
pygame-ce 2.5.5 (SDL 2.32.6, Python 3.12.3)
>>> r = pygame.Rect(10,20,30,40)
>>> fr = pygame.FRect(10,20,30,40)
>>>
>>> 10 in r
True
>>> 10.0 in r
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'in <pygame.rect.Rect>' requires rect style object or int as left operand
>>>
>>> 10 in fr
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'in <pygame.rect.FRect>' requires rect style object or int as left operand
>>> 10.0 in fr
True

FRect requires a float as the left operand but the error message says it requires an int.

TypeError: 'in <pygame.rect.FRect>' requires rect style object or int as left operand

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions