-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add stubs for itsdangerous. #537
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 is needed for python#28
Is itsdangerous covered by the developer approval for flask?
|
@gvanrossum Gah, you're correct. They gave me permission for |
@gvanrossum Gave me the good to go here - pallets/itsdangerous#69 |
int_to_byte = chr | ||
number_types = (int, long, float) | ||
|
||
bytes_like = Union[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.
Hm... I wonder if even for 2.7 it's better to use bytes instead of str? Honestly I have no idea what this package does (and no time to research it) so if you don't think that's a good idea I'll take your word for it. If you do, maybe it should go into 2and3?
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.
Hmm, that's an interesting idea. I forgot that bytes
aliases to str
in Python 2. The main motivation for splitting things up is it actually gets quite complicated in Python 3 as to which methods can take strings and which ones have to take a bytes_like
value. I'll investigate unifying the stybs.
Let me know. I'm also okay with merging as-is; I have no stomach to review this carefully. |
Ping? Do you want me to merge this now or are you planning to do something about the bytes? |
I'm just going to merge this as-is, if you change your mind about bytes you can submit a follow-up PR. Thanks for doing this! |
@gvanrossum Sorry I dropped the ball here, other things came up (mostly around adopting PEP 484 and selling it to other folks 😄). I will give it a go to make this a 2and3 module. As an aside, say I were to get these types upstreamed into the module itself as opposed to typeshed. Is there any way in mypy or any of the other type checkers to specify something of the form "Check the module itself, and if it's missing types fall back to typeshed"? |
We had a long discussion about inline annotations in library modules in the mypy issue tracker, but it's still unresolved: python/mypy#1190 |
This is needed for #28