-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
imaplib: _Authenticator also works with bytearray #9056
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
Conversation
This comment has been minimized.
This comment has been minimized.
stdlib/imaplib.pyi
Outdated
def process(self, data: str) -> str: ... | ||
def encode(self, inp: bytes) -> str: ... | ||
def encode(self, inp: bytes | bytearray) -> 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.
I think this is str | (Buffer & Sequence)
, e.g. don't see anything stopping memoryview
from working here
stdlib/imaplib.pyi
Outdated
def process(self, data: str) -> str: ... | ||
def encode(self, inp: bytes) -> str: ... | ||
def encode(self, inp: bytes | bytearray) -> str: ... | ||
def decode(self, inp: str) -> bytes: ... |
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 think this is str | _BufferWithLen
stdlib/imaplib.pyi
Outdated
@@ -151,10 +151,10 @@ class IMAP4_stream(IMAP4): | |||
def open(self, host: str | None = ..., port: int | None = ...) -> None: ... | |||
|
|||
class _Authenticator: | |||
mech: Callable[[bytes], bytes] | |||
def __init__(self, mechinst: Callable[[bytes], bytes]) -> None: ... | |||
mech: Callable[[bytes], bytes | bytearray | 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 think this can return str as well
This comment has been minimized.
This comment has been minimized.
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!
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
No description provided.