Skip to content

Commit

Permalink
changed argument from O|i to O|p for collidedict and collidedictall
Browse files Browse the repository at this point in the history
  • Loading branch information
oddbookworm committed Aug 19, 2023
1 parent bf10bd3 commit b075e54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src_c/rect_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,7 @@ RectExport_collidedict(RectObject *self, PyObject *args, PyObject *kwargs)

char *kwds[] = {"rect_dict", "values", NULL};

if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i", kwds, &dict,
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|p", kwds, &dict,
&values)) {
return NULL;
}
Expand Down Expand Up @@ -1573,7 +1573,7 @@ RectExport_collidedictall(RectObject *self, PyObject *args, PyObject *kwargs)

char *kwds[] = {"rect_dict", "values", NULL};

if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i", kwds, &dict,
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|p", kwds, &dict,
&values)) {
return NULL;
}
Expand Down
20 changes: 0 additions & 20 deletions test/rect_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1941,15 +1941,6 @@ def test_collidedict__invalid_dict_key_format(self):
with self.assertRaises(TypeError):
collide_item = rect.collidedict(rect_values)

def test_collidedict__invalid_values_format(self):
"""Ensures collidedict correctly handles invalid values parameters."""
rect = Rect(0, 0, 1, 1)
d = {}

for invalid_param in (None, d, 1.1):
with self.assertRaises(TypeError):
collide_item = rect.collidedict(d, invalid_param)

def test_collidedict__kwarg(self):
"""Ensures the values keyword works with collidedict"""
rects = [Rect(i, i, i, i) for i in range(1, 5)]
Expand Down Expand Up @@ -2220,17 +2211,6 @@ def test_collidedictall__invalid_dict_key_format(self):
with self.assertRaises(TypeError):
collide_items = rect.collidedictall(rect_values)

def test_collidedictall__invalid_values_format(self):
"""Ensures collidedictall correctly handles invalid values
parameters.
"""
rect = Rect(0, 0, 1, 1)
d = {}

for invalid_param in (None, d, 1.1):
with self.assertRaises(TypeError):
collide_items = rect.collidedictall(d, invalid_param)

def test_collidedictall__kwarg(self):
"""Ensures the values keyword works with collidedictall"""
rects = [Rect(i, i, i, i) for i in range(1, 5)]
Expand Down

0 comments on commit b075e54

Please sign in to comment.