Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added functions return typing in some files: __init__.py; keys.py and lazyre.py#1003

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sebastinas merged 1 commit intobpython:mainfromJLMSC:main
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes fromall 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
3 changes: 2 additions & 1 deletionbpython/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,6 +21,7 @@
# THE SOFTWARE.

import os.path
from typing import Any

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


def embed(locals_=None, args=None, banner=None):
def embed(locals_=None, args=None, banner=None) -> Any:
if args is None:
args = ["-i", "-q"]

Expand Down
4 changes: 2 additions & 2 deletionsbpython/keys.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,10 +42,10 @@ def __getitem__(self, key: str) -> T:
f"Configured keymap ({key}) does not exist in bpython.keys"
)

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

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


Expand Down
4 changes: 2 additions & 2 deletionsbpython/lazyre.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,7 +21,7 @@
# THE SOFTWARE.

import re
from typing import Optional, Pattern, Match, Optional
from typing import Optional, Pattern, Match, Optional, Iterator

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

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

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

[8]ページ先頭

©2009-2025 Movatter.jp