-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
stub for poplib #1211
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
stub for poplib #1211
Conversation
Strictly speaking, some of these methods, like |
Thanks, you're right. I'm just changing all the str types to Text. Strictly speaking maybe the class should be generic over AnyStr in Python 2, but that feels like overkill, so I'd prefer to not do that until we find that it causes issues in real code. |
It didn't occur to me, until just now, that because of the In general, is that the behavior we want? Or do we want to explicitly say |
Actually, moving this question into python/typing#418, and merging this stub in its current version. |
def pass_(self, pswd: Text) -> bytes: ... | ||
def stat(self) -> Tuple[int, int]: ... | ||
def list(self, which: Optional[Text] = ...) -> bytes: ... | ||
def retr(self, which: Text) -> 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 just found (through testing against some working code) that this is wrong -- it returns a tuple (https://docs.python.org/2/library/poplib.html#poplib.POP3.retr). It also conceivably accepts an int as argument.
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.
You're right, I'll submit another PR to fix.
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 for the argument type, it really accepts anything because the only thing it does with the argument is "%s". I think I put Text because that's the only type that's actually used in the tests. I think I'll just make it Any instead to be safe.
Fixes a problem introduced in #1211.
No description provided.