-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 m3u8 #12683
base: main
Are you sure you want to change the base?
add stubs for m3u8 #12683
Conversation
This comment has been minimized.
This comment has been minimized.
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 full review, just a few things I noticed.
This comment has been minimized.
This comment has been minimized.
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! A few notes below. Also, please either add a short comment explaining the allowed types for each Any
or change the Any
s to Incomplete
for now.
@@ -0,0 +1,27 @@ | |||
# mypy: disable-error-code="attr-defined" |
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.
Why is this necessary. In general, we prefer # type: ignore[attr-defined]
on the lines that this actually affects.
|
||
_T = TypeVar("_T") | ||
|
||
class BasePathMixin(Protocol): |
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.
As this is not a protocol at runtime, it shouldn't be a protocol here either.
@type_check_only | ||
class _PlaylistProtocol(BasePathMixin, metaclass=ABCMeta): | ||
base_uri: str | 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.
To make this then work correctly, it should be changed to:
@type_check_only | |
class _PlaylistProtocol(BasePathMixin, metaclass=ABCMeta): | |
base_uri: str | None | |
@type_check_only | |
class _PlaylistProtocol(Protocol): | |
base_uri: str | None | |
uri: str | None | |
@property | |
def absolute_uri(self) -> str: ... | |
@property | |
def base_path(self) -> str: ... | |
@base_path.setter | |
def base_path(self, newbase_path: str) -> None: ... | |
def get_path_from_uri(self) -> str: ... |
No description provided.