Skip to content

Commit 5db3e08

Browse files
authored
Merge pull request #1003 from JLMSC/main
Added functions return typing in some files: __init__.py; keys.py and lazyre.py
2 parents 3a44027 + 3fda3af commit 5db3e08

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

bpython/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# THE SOFTWARE.
2222

2323
import os.path
24+
from typing import Any
2425

2526
try:
2627
from ._version import __version__ as version # type: ignore
@@ -36,7 +37,7 @@
3637
package_dir = os.path.abspath(os.path.dirname(__file__))
3738

3839

39-
def embed(locals_=None, args=None, banner=None):
40+
def embed(locals_=None, args=None, banner=None) -> Any:
4041
if args is None:
4142
args = ["-i", "-q"]
4243

bpython/keys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def __getitem__(self, key: str) -> T:
4242
f"Configured keymap ({key}) does not exist in bpython.keys"
4343
)
4444

45-
def __delitem__(self, key: str):
45+
def __delitem__(self, key: str) -> None:
4646
del self.map[key]
4747

48-
def __setitem__(self, key: str, value: T):
48+
def __setitem__(self, key: str, value: T) -> None:
4949
self.map[key] = value
5050

5151

bpython/lazyre.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# THE SOFTWARE.
2222

2323
import re
24-
from typing import Optional, Pattern, Match, Optional
24+
from typing import Optional, Pattern, Match, Optional, Iterator
2525

2626
try:
2727
from functools import cached_property
@@ -43,7 +43,7 @@ def __init__(self, regex: str, flags: int = 0) -> None:
4343
def compiled(self) -> Pattern[str]:
4444
return re.compile(self.regex, self.flags)
4545

46-
def finditer(self, *args, **kwargs):
46+
def finditer(self, *args, **kwargs) -> Iterator[Match[str]]:
4747
return self.compiled.finditer(*args, **kwargs)
4848

4949
def search(self, *args, **kwargs) -> Optional[Match[str]]:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy