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
Update emoji (3rd party) library #7884
Conversation
Not sure if this is the correct method, but it seemed the most logical thing.
Again, not sure if this is how it works. Perhaps the source code has been updated [1], and separate language files don't make sense any more? [1]: (current source code): https://github.com/carpedm20/emoji/tree/master/emoji/unicode_codes
This comment has been minimized.
This comment has been minimized.
Apparently we have to use collections.abc.Callable instead of typing.Callable, is that right?
This comment has been minimized.
This comment has been minimized.
From `emoji/core.py`, "handle_version can be either a string or a callable; If it is a callable, it's passed the unicode emoji and the data dict from emoji.EMOJI_DATA [which is dict[str, dict[str, str]]] and must return a replacement string to be used." [1] [1]: https://github.com/carpedm20/emoji/blob/master/emoji/core.py#L74
This comment has been minimized.
This comment has been minimized.
Wow, checking the stubs with the actual third party code is awesome! I have a question on how I can solve this error. The error given is:
Which makes sense, since they changed the |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Welcome to the project! PRs improving our stubs are very welcome here :)
To tackle the stubtest error for class _DeprecatedParameter: ...
def demojize(
string: str,
use_aliases: bool | type[_DeprecatedParameter] = ...,
delimiters: tuple[str, str] = ...,
language: str = ...,
version: float | int | None = ...,
handle_version: str | Callable[[str, dict[str, str]], str] | None = ...,
) -> str: ... Since the |
This comment has been minimized.
This comment has been minimized.
Thanks!
Alright makes sense, thanks for the review and tip! |
@AlexWaygood mentioned everything I did and more, no need to have a duplicate review.
According to PEP 484, type checkers should treat int as an implicit subtype of float.
Thanks for the useful review tips! I have added |
According to mypy_primer, this change has no effect on the checked open source code. |
Stubtest's happy, primer's happy, I'm happy. Thanks again!
I'm new to typeshed, hopefully this is OK.