Skip to content

Make translator ignore names starting uppercase - #112

Merged
hx2A merged 1 commit into
py5coding:mainfrom
villares:patch-2
Aug 9, 2022
Merged

hx2A merged 1 commit into
py5coding:mainfrom
villares:patch-2

Conversation

@villares

@villares villares commented Aug 8, 2022 •

Copy link
Copy Markdown
Collaborator

This looks a bit desperate, but I can't think of anything else to fix #111 right now.
See if you can anticipate any terrible consequences, and do ignore/close if you see fit.

Note: As the Python "special" names, like None, True and False, go in this new rule, I changed SNAKE_CASE_OVERRIDE to SPECIAL_CASES

This looks a bit desperate, but I can't think of anything else right now.
See if you can anticipate any terrible consequences. 
Note: As the Python "special" names, like `None`, `True` and `False`, go in this new rule, I changed SNAKE_CASE_OVERRIDE to SPECIAL_CASES
@hx2A

hx2A commented Aug 8, 2022

Copy link
Copy Markdown
Collaborator

Testing if the first character is upper case is the first idea I came up with to address this. I can't anticipate any terrible consequences from this change, and I can't think of a better way right now. The translators all use heuristics after all, and this is an improvement to the heuristics. Ideally the translators will take care of all of the rote changes and will leave you with only stuff that requires human thought.

I am still doing the release today. Normally I would consider a PR on day of a release to be too risky, but I can see this is a small change that can't impact any other part of the library. If you are OK with it being included, I'll add it to the release.

@villares

villares commented Aug 8, 2022 •

Copy link
Copy Markdown
Collaborator Author

Few people are using the translators yet, I suppose. My testing:
image

@hx2A

hx2A commented Aug 9, 2022

Copy link
Copy Markdown
Collaborator

OK, let's do it!

@hx2A
hx2A merged commit 07bdca4 into py5coding:main Aug 9, 2022
@villares
villares deleted the patch-2 branch August 9, 2022 03:28
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.

py5_tools.translators.processingpy2imported acting strange (converting class names it should not touch)

2 participants