Skip to content

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

Merged
merged 1 commit into from
Sep 18, 2016
Merged

Conversation

rowillia
Copy link
Contributor

This is needed for #28

@gvanrossum
Copy link
Member

gvanrossum commented Sep 12, 2016 via email

@rowillia
Copy link
Contributor Author

@gvanrossum Gah, you're correct. They gave me permission for jinja and werkzeug but not itsdangerous. Will poke in that repo.

@rowillia
Copy link
Contributor Author

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

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?

Copy link
Contributor Author

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.

@gvanrossum
Copy link
Member

Let me know. I'm also okay with merging as-is; I have no stomach to review this carefully.

@gvanrossum
Copy link
Member

Ping? Do you want me to merge this now or are you planning to do something about the bytes?

@gvanrossum
Copy link
Member

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 gvanrossum merged commit b5e372b into python:master Sep 18, 2016
@rowillia
Copy link
Contributor Author

rowillia commented Sep 20, 2016

@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"?

@JukkaL
Copy link
Contributor

JukkaL commented Sep 20, 2016

We had a long discussion about inline annotations in library modules in the mypy issue tracker, but it's still unresolved: python/mypy#1190

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