Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3bf9fb0

Browse files
committed
mymax: fixed type hint in test
1 parent98903bc commit3bf9fb0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎less_than/max_steps/04_multi_args_key/mymax.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ def __lt__(self, other: Any) -> bool:
1919

2020
T=TypeVar('T')
2121
LessT=TypeVar('LessT',bound=SupportsLessThan)
22-
22+
KeyFunc=Callable[[T],LessT]
2323

2424
@overload
2525
defmax(first:LessT,*rest:LessT,key:None= ...)->LessT:
2626
...
2727
@overload
28-
defmax(first:T,*rest:T,key:Callable[[T],LessT])->T:
28+
defmax(first:T,*rest:T,key:KeyFunc)->T:
2929
...
3030
defmax(first,*rest,key=None):
3131
candidate=first

‎less_than/max_steps/04_multi_args_key/mymax_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fromtypingimportTypeVar,Iterable,Optional,Callable
44

55
importmymax
6-
frommymaximportLessT
6+
frommymaximportLessT,KeyFunc
77

88
importpytest
99

@@ -89,7 +89,7 @@ def test_multi_params(
8989
deftest_multi_with_key_params(
9090
first:LessT,
9191
rest:Iterable[LessT],
92-
key:Optional[Callable[[T],LessT]],
92+
key:Optional[KeyFunc],
9393
expected:LessT,
9494
)->None:
9595
result=mymax.max(first,*rest,key=key)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp