8000 imaplib: _Authenticator also works with bytearray by JelleZijlstra · Pull Request #9056 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 5 commits into from
Nov 3, 2022

Conversation

JelleZijlstra
Copy link
Member

No description provided.

@github-actions

This comment has been minimized.

def process(self, data: str) -> str: ...
def encode(self, inp: bytes) -> str: ...
def encode(self, inp: bytes | bytearray) -> str: ...
Copy link
Collaborator

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

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: ...
Copy link
Collaborator

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

@@ -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]
Copy link
Collaborator

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

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Collaborator
@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-actions
Copy link
Contributor
github-actions bot commented Nov 3, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@hauntsaninja hauntsaninja merged commit 460158f into python:main Nov 3, 2022
@JelleZijlstra JelleZijlstra deleted the imaplib branch November 3, 2022 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0