Skip to content

Commit

Permalink
Use --no-implicit-optional for type checking (psf#3220)
Browse files Browse the repository at this point in the history
This makes type checking PEP 484 compliant (as of 2018).
mypy will change its defaults soon.

See:
python/mypy#9091
python/mypy#13401
  • Loading branch information
hauntsaninja authored and hugovk committed Sep 3, 2022
1 parent 29c3787 commit fe855e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ warn_no_return=True
warn_redundant_casts=True
warn_unused_ignores=True
disallow_any_generics=True
no_implicit_optional=True

# Unreachable blocks have been an issue when compiling mypyc, let's try
# to avoid 'em in the first place.
Expand Down
2 changes: 1 addition & 1 deletion src/blib2to3/pgen2/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def add_token(self, tok_type: int, tok_val: Text, raw: bool = False) -> None:
args.insert(0, ilabel)
func(*args)

def determine_route(self, value: Text = None, force: bool = False) -> Optional[int]:
def determine_route(self, value: Optional[Text] = None, force: bool = False) -> Optional[int]:
alive_ilabels = self.ilabels
if len(alive_ilabels) == 0:
*_, most_successful_ilabel = self._dead_ilabels
Expand Down

0 comments on commit fe855e7

Please sign in to comment.