Skip to content

Commit 9d38af3

Browse files
Fix stdlib test for copy.replace
1 parent 51685bf commit 9d38af3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/@tests/test_cases/check_copy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ReplaceableClass:
1010
def __init__(self, val: int) -> None:
1111
self.val = val
1212

13-
def __replace__(self, val: int) -> Self:
13+
def __replace__(self, /, *, val: int) -> Self:
1414
cpy = copy.copy(self)
1515
cpy.val = val
1616
return cpy
@@ -29,11 +29,11 @@ class Box(Generic[_T_co]):
2929
def __init__(self, value: _T_co, /) -> None:
3030
self.value = value
3131

32-
def __replace__(self, value: str) -> Box[str]:
32+
def __replace__(self, /, *, value: str) -> Box[str]:
3333
return Box(value)
3434

3535

3636
if sys.version_info >= (3, 13):
3737
box1: Box[int] = Box(42)
38-
box2 = copy.replace(box1, val="spam")
38+
box2 = copy.replace(box1, value="spam")
3939
assert_type(box2, Box[str])

0 commit comments

Comments
 (0)