Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 0 additions & 64 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3291,14 +3291,6 @@
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
"startColumn": 4,
"endColumn": 11,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
Expand All @@ -3307,62 +3299,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 4,
"endColumn": 22,
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 23,
"endColumn": 31,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
"startColumn": 23,
"endColumn": 31,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 8,
"endColumn": 11,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 13,
"endColumn": 18,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 22,
"endColumn": 36,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 11,
"endColumn": 17,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
Expand Down
8 changes: 5 additions & 3 deletions pytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@
R = TypeVar("R")
F = TypeVar("F", bound=Callable[..., Any])
P = ParamSpec("P")
K = TypeVar("K")
V = TypeVar("V")

# }}}

Expand Down Expand Up @@ -1120,13 +1122,13 @@ def partition2(iterable):
return part_true, part_false


def product(iterable: Iterable[Any]) -> Any:
def product(iterable: Iterable[T]) -> T | int:
from operator import mul
return reduce(mul, iterable, 1)


def reverse_dictionary(the_dict):
result = {}
def reverse_dictionary(the_dict: Mapping[K, V]) -> dict[V, K]:
result: dict[V, K] = {}
for key, value in the_dict.items():
if value in result:
raise RuntimeError(
Expand Down
Loading