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

Automatically update when a reserved keyword is used as an enum in ACT (Python bindings) #207

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

vijaiaeroastro
Copy link

@vijaiaeroastro vijaiaeroastro commented Jul 8, 2024

This patch maintains a dictionary of Python keywords, which can be obtained using the following code:

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keyword
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

This patch warns the user and automatically changes the enum LHS to enum_name + enum_option_name. It fixes the issue (#145) in lib3mf immediately. The scope of this needs to be expanded to the rest of the code. I believe it is even better to check the XML file at the beginning and produce a modified XML file to avoid any changes to ACT code. That would be a more feasible option. Feedback is welcome.

… after python binding generation is now automated inside act. The scope needs to be expanded across the script
@vijaiaeroastro vijaiaeroastro changed the title Automatically change when a reserved keyword is used as an enum in ACT (Python bindings) Automatically update when a reserved keyword is used as an enum in ACT (Python bindings) Jul 8, 2024
@alexanderoster alexanderoster merged commit f650618 into Autodesk:develop Sep 4, 2024
11 of 13 checks passed
gangatp pushed a commit that referenced this pull request Dec 11, 2024
…T (Python bindings) (#207)

* Start with fixing the problematic enum in ACT. The current patch done after python binding generation is now automated inside act. The scope needs to be expanded across the script

* Extend the reserved keyword check across the entire Python binding
gangatp pushed a commit that referenced this pull request Dec 16, 2024
…T (Python bindings) (#207)

* Start with fixing the problematic enum in ACT. The current patch done after python binding generation is now automated inside act. The scope needs to be expanded across the script

* Extend the reserved keyword check across the entire Python binding
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.

2 participants