8000 Tighter types for strconv, report and check* by elazarg · Pull Request #2223 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Tighter types for strconv, report and check* #2223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
minor
  • Loading branch information
elazarg committed Oct 10, 2016
commit afc3dff8e402c7e6b70292d56998b239c1bc7673
2 changes: 1 addition & 1 deletion mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,7 @@ def expand_func(defn: FuncItem, map: Dict[TypeVarId, Type]) -> FuncItem:
visitor = TypeTransformVisitor(map)
ret = defn.accept(visitor)
assert isinstance(ret, FuncItem)
return cast(FuncItem, ret)
return ret


class TypeTransformVisitor(TransformVisitor):
Expand Down
3 changes: 1 addition & 2 deletions mypy/checkstrformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ def replacement_checkers(self, specifier: ConversionSpecifier,
of the right type for the specifier. The first functions take a node and checks
its type in the right type context. The second function just checks a type.
"""
checkers = [
] # type: List[ Tuple[ Callable[[Expression], None], Callable[[Type], None] ] ]
checkers = [] # type: List[Tuple[Callable[[Expression], None], Callable[[Type], None]]]

if specifier.width == '*':
checkers.append(self.checkers_for_star(context))
Expand Down
2 changes: 1 addition & 1 deletion mypy/strconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class StrConv(NodeVisitor[str]):
"""Visitor for converting nodes to a human-readable string.
"""Visitor for converting a node to a human-readable string.

For example, an MypyFile node from program '1' is converted into
something like this:
Expand Down
2 changes: 1 addition & 1 deletion typeshed
0