-
Notifications
You must be signed in to change notification settings - Fork 5
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
Installability and Compatibility #1
base: main
Are you sure you want to change the base?
Conversation
That is a reverse dictionary. I agree that it shouldn't be created every time |
Correct me if I'm wrong, couldn't you use
|
Oh, you are right. Probably better to create that outside of the function.
|
I knew about the |
I did Unless I'm misunderstanding it. |
I guess this is a curse of the spec again on whether non-trailing byte separators should be disallowed. |
Yeah, kinda weird to require trailing separators tbh. I just followed the spec here, but I guess I can add |
Just FYI: the spec as of yet is not a reliable source as it has plenty of ambiguity not yet sorted out. |
Actually just noticed that reversing the dict is completely unnecessary as we never need the original dict. (value -> emoji) |
I added a basic
setup.py
to make the package installable over git and also replaced theremovesuffix
method because it's only available in Python 3.9.Ordinary dicts are only guaranteed to be ordered in Python 3.6+. Using them could potentially break the encoding for older Python versions.
It's also questionable if this iteration through the whole string is necessary as we could also check the validity in the iteration later:
I also don't see a reason to create a copy of the whole character dict here:
I didn't want to put these two parts into the Pull Request as I don't know if there are reasons for them.