-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add stubs for aws_xray_sdk #12587
base: main
Are you sure you want to change the base?
Add stubs for aws_xray_sdk #12587
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@srittau can you please review my PR if it's not difficult!) |
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! Not a complete review yet, just a few things I noticed. Also, my question about private attributes from the other PR applies here as well.
def __init__( | ||
self, *args: ParamSpecArgs, loop: Incomplete | None = None, use_task_factory: bool = True, **kwargs: ParamSpecKwargs | ||
) -> None: ... |
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.
I've never seen ParamSpecArgs
used like this. It seems that *args
and **kwargs
are just passed on to the super class in the implementation. I suggest to just copy the super class argument:
def __init__( | |
self, *args: ParamSpecArgs, loop: Incomplete | None = None, use_task_factory: bool = True, **kwargs: ParamSpecKwargs | |
) -> None: ... | |
def __init__( | |
self, context_missing: str = "LOG_ERROR", loop: Incomplete | None = None, use_task_factory: bool = True | |
) -> None: ... |
def __getattribute__(self, item: str): ... | ||
def __init__(self, loop: AbstractEventLoop | None = None) -> None: ... | ||
def __setattr__(self, name: str, value: str) -> None: ... | ||
def __getattribute__(self, item: str) -> str: ... |
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.
This can return other types than just str
, but that's hard to express.
def __getattribute__(self, item: str) -> str: ... | |
# Forwards attribute access to task.context (if set). | |
def __getattribute__(self, item: str) -> Any: ... |
def send_entity(self, entity) -> None: ... | ||
def set_daemon_address(self, address) -> None: ... | ||
def __init__(self, daemon_address: str = "127.0.0.1:2000") -> None: ... | ||
def send_entity(self, entity: Any) -> None: ... |
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.
We require a comment (or type alias) for any use of Any
. In this case, we could do better by adding a protocol like this and using it here:
@type_check_only
class _HasSerialize(Protocol):
def serialize(self) -> str: ...
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
No description provided.