chore: add encoding= to open() and type hints in setup.py and utils.py#32
Open
mangodxd wants to merge 1 commit intodanielkaiser:masterfrom
Open
chore: add encoding= to open() and type hints in setup.py and utils.py#32mangodxd wants to merge 1 commit intodanielkaiser:masterfrom
mangodxd wants to merge 1 commit intodanielkaiser:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
I noticed a few areas where the code could be made a bit more robust and readable. This PR focuses on minor housekeeping tasks and does not change any of the existing runtime logic:
Explicit encoding for file operations
setup.py: addedencoding="utf-8"to 1open()call(s)I added explicit encoding here because Python's default behavior depends on the operating system. This change ensures the code handles text consistently whether it is running on Windows, Linux, or macOS, preventing potential UnicodeDecodeErrors.
Type hint additions
setup.py: added type hints to 1 function(s)utils.py: added type hints to 9 function(s)I have added basic type annotations based on variable names and default values. This should make the code easier to work with in modern IDEs without changing any of the actual logic.
Examples of changes
Example change in
setup.py:Example change in
utils.py:Safety and verification
ast.parse()to ensure no syntax errors were introduced.eval()orglobals()were automatically skipped.__init__.pyfiles.Let me know if you would like me to change anything here.