Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
tchalupnik committed Sep 24, 2024
1 parent bb07d37 commit ba7af9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/prompt_toolkit/contrib/regular_languages/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,9 @@ def __repr__(self) -> str:
def get(self, key: str) -> str | None: ...

@overload
def get(self, key: str, default: _T = None) -> str | _T: ...
def get(self, key: str, default: str | _T) -> str | _T: ...

def get(self, key: str, default: _T = None) -> str | _T:
def get(self, key: str, default: str | _T | None = None) -> str | _T | None:
items = self.getall(key)
return items[0] if items else default

Expand Down

0 comments on commit ba7af9c

Please sign in to comment.