-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add bdb stubs #3354
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
Add bdb stubs #3354
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cf946bd
Add stubs for bdb module
CraftSpider e47879a
Change file variables to 'Text' as filenames can include unicode char…
CraftSpider 456f147
Revert last commit, checked runtime type for Py2 and it's definitely str
CraftSpider af54564
frame_returning is not just None, add reasoning for `type: ignore`
CraftSpider 04b1401
Fix pytype tests
CraftSpider 3fdc2ad
Add `Optional` to types missing it
CraftSpider 28dc782
set_trace FrameType is also Optional
CraftSpider File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
|
|
||
| from typing import Set, Dict, Iterable, Any, Callable, Tuple, Type, SupportsInt, List, Union, TypeVar, Optional, IO | ||
| from types import FrameType, TracebackType, CodeType | ||
|
|
||
|
|
||
| _T = TypeVar("_T") | ||
| _TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type | ||
| _ExcInfo = Tuple[Type[BaseException], BaseException, FrameType] | ||
|
|
||
| GENERATOR_AND_COROUTINE_FLAGS: int = ... | ||
|
|
||
| class BdbQuit(Exception): ... | ||
|
|
||
| class Bdb: | ||
|
|
||
| skip: Optional[Set[str]] | ||
| breaks: Dict[str, List[int]] | ||
| fncache: Dict[str, str] | ||
| frame_returning: Optional[FrameType] | ||
| botframe: Optional[FrameType] | ||
| quitting: bool | ||
| stopframe: Optional[FrameType] | ||
| returnframe: Optional[FrameType] | ||
| stoplineno: int | ||
|
|
||
| def __init__(self, skip: Iterable[str] = ...) -> None: ... | ||
| def canonic(self, filename: str) -> str: ... | ||
| def reset(self) -> None: ... | ||
| def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> _TraceDispatch: ... | ||
| def dispatch_line(self, frame: FrameType) -> _TraceDispatch: ... | ||
| def dispatch_call(self, frame: FrameType, arg: None) -> _TraceDispatch: ... | ||
| def dispatch_return(self, frame: FrameType, arg: Any) -> _TraceDispatch: ... | ||
| def dispatch_exception(self, frame: FrameType, arg: _ExcInfo) -> _TraceDispatch: ... | ||
| def is_skipped_module(self, module_name: str) -> bool: ... | ||
| def stop_here(self, frame: FrameType) -> bool: ... | ||
| def break_here(self, frame: FrameType) -> bool: ... | ||
| def do_clear(self, arg: Any) -> None: ... | ||
| def break_anywhere(self, frame: FrameType) -> bool: ... | ||
| def user_call(self, frame: FrameType, argument_list: None) -> None: ... | ||
| def user_line(self, frame: FrameType) -> None: ... | ||
| def user_return(self, frame: FrameType, return_value: Any) -> None: ... | ||
| def user_exception(self, frame: FrameType, exc_info: _ExcInfo) -> None: ... | ||
| def set_until(self, frame: FrameType, lineno: Optional[int] = ...) -> None: ... | ||
| def set_step(self) -> None: ... | ||
| def set_next(self, frame: FrameType) -> None: ... | ||
| def set_return(self, frame: FrameType) -> None: ... | ||
| def set_trace(self, frame: Optional[FrameType] = ...) -> None: ... | ||
| def set_continue(self) -> None: ... | ||
| def set_quit(self) -> None: ... | ||
| def set_break(self, filename: str, lineno: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ... | ||
| def clear_break(self, filename: str, lineno: int) -> None: ... | ||
| def clear_bpbynumber(self, arg: SupportsInt) -> None: ... | ||
| def clear_all_file_breaks(self, filename: str) -> None: ... | ||
| def clear_all_breaks(self) -> None: ... | ||
| def get_bpbynumber(self, arg: SupportsInt) -> Breakpoint: ... | ||
| def get_break(self, filename: str, lineno: int) -> bool: ... | ||
| def get_breaks(self, filename: str, lineno: int) -> List[Breakpoint]: ... | ||
| def get_file_breaks(self, filename: str) -> List[Breakpoint]: ... | ||
| def get_all_breaks(self) -> List[Breakpoint]: ... | ||
| def get_stack(self, f: FrameType, t: TracebackType) -> Tuple[List[Tuple[FrameType, int]], int]: ... | ||
| def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ... | ||
| def run(self, cmd: Union[str, CodeType], globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> None: ... | ||
| def runeval(self, expr: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> None: ... | ||
| def runctx(self, cmd: Union[str, CodeType], globals: Dict[str, Any], locals: Dict[str, Any]) -> None: ... | ||
| def runcall(self, func: Callable[[Any], _T], *args: Any, **kwds: Any) -> Optional[_T]: ... | ||
|
|
||
| class Breakpoint: | ||
|
|
||
| next: int = ... | ||
| bplist: Dict[Tuple[str, int], List[Breakpoint]] = ... | ||
| bpbynumber: List[Optional[Breakpoint]] = ... | ||
|
|
||
| funcname: Optional[str] | ||
| func_first_executable_line: Optional[int] | ||
| file: str | ||
| line: int | ||
| temporary: bool | ||
| cond: Optional[str] | ||
| enabled: bool | ||
| ignore: int | ||
| hits: int | ||
| number: int | ||
|
|
||
| def __init__(self, file: str, line: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ... | ||
| def deleteMe(self) -> None: ... | ||
| def enable(self) -> None: ... | ||
| def disable(self) -> None: ... | ||
| def bpprint(self, out: Optional[IO[str]] = ...) -> None: ... | ||
| def bpformat(self) -> str: ... | ||
| def __str__(self) -> str: ... | ||
|
|
||
| def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... | ||
| def effective(file: str, line: int, frame: FrameType) -> Union[Tuple[Breakpoint, bool], Tuple[None, None]]: ... | ||
| def set_trace() -> None: ... | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
globals and locals are Optional for all of these