Skip to content
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

Type hints #166

Merged
merged 4 commits into from
Sep 17, 2022
Merged

Type hints #166

merged 4 commits into from
Sep 17, 2022

Conversation

landgrafhomyak
Copy link
Contributor

Added type hints (.pyi) to all scripts and packages
Added classifier 'Typing :: Typed'

@kkirsche
Copy link

kkirsche commented Aug 4, 2022

2.0.0 type hints I did for typeshed:

python/typeshed#8426

@cvzi
Copy link
Contributor

cvzi commented Aug 4, 2022

@kkirsche Can/Should this be somehow included in the module? (I don't know much about typing in python)

@kkirsche
Copy link

kkirsche commented Aug 4, 2022

@cvzi It depends. Anyone who wants type hints for emoji while @carpedm20 chooses not to include them would need to install the additional types-emoji package to get the type hints. This is important if you choose to use type hints with tools like pyright, mypy, or other type checkers.

In my opinion, yes, they can and should be a part of the library and the associated py.typed marker should be added to indicate that the library supports type hints.

As Python 2.7 is still supported, per https://github.com/carpedm20/emoji/blob/master/setup.py#L42, this would be done by including the .pyi files into this library. This would be done instead of inline type hints so that newer style types can be used outside of comment-formatted type hints.

# Conflicts:
#	emoji/core.py
@cvzi
Copy link
Contributor

cvzi commented Aug 4, 2022

Thanks for the explanation.
@TahirJalilov is the maintainer, so it's up to him to decide.

I would agree that it should be included.

I don't know if @TahirJalilov is familiar with type hints or if he is as clueless as I. But since your pull request was reviewed and approved at typeshed, everything should be in order anyway.

And yes the setup.py is correct, Python 2.7 is still supported.

@landgrafhomyak
Copy link
Contributor Author

Synced with typeshed stubs

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.

4 participants