-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[gdb] Complete stubs for gdb.dap
#14269
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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.
Thanks, and sorry for the delay. A few notes below.
moduleId: NotRequired[str | None] | ||
source: NotRequired[Source] | ||
|
||
class _StaceTraceResult(TypedDict): |
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.
Just to verify: Should this be annotated with @type_check_only
as well?
def read_json(stream: BinaryIO) -> Any: ... # returns result of json.loads | ||
def start_json_writer(stream: BinaryIO, queue: DAPQueue[_JSONValue]) -> gdb.Thread: ... |
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.
Can we use a protocol (potentially an already existing one from _typeshed
) instead of the semi-deprecated BinaryIO
here?
from _typeshed import Incomplete, Unused | ||
from collections.abc import Callable | ||
from contextlib import AbstractContextManager | ||
from typing import Any, BinaryIO, Generic, TypeVar, type_check_only |
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.
Same here for BinaryIO
.
@type_check_only | ||
class ValueFormat(TypedDict, total=False): | ||
hex: bool | ||
|
||
@type_check_only | ||
class ReferenceDescriptor(TypedDict): | ||
# Result of BaseReference.to_object() | ||
variableReference: int | ||
name: NotRequired[str] | ||
|
||
@type_check_only | ||
class VariableReferenceDescriptor(ReferenceDescriptor): |
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.
If they are type check only, their names should start with an underscore.
Fill in stubs for
gdb.dap
, originally introduced in #12804.Based on gdb sources at the tag
gdb-15.2-release
.(PEP 764 would have been reeeally nice here)