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

Consistent order of generated code #17

Merged
merged 1 commit into from
Mar 15, 2019
Merged

Consistent order of generated code #17

merged 1 commit into from
Mar 15, 2019

Conversation

rreilink
Copy link
Contributor

In order to facilitate the merging with (regular) Python code generation, I need generated code which is always the same, regardless of Python version (in order to facilitate comparison of the generated code: refactoring of the code generator should not lead to a change in the generated code)

The current gen_mpy.py depends on Python dict iteration order, which is different between Python versions. I modified it to use collections.OrderedDict to get consistent output.

Only the order of methods, functions, attributes etc is changed, so it will not change the functioning of the generated code.

… order of generated code is always the same (Python2 vs. Python3 < 3.6 vs. Python3 >= 3.6 have different dict iteration order))
@embeddedt embeddedt requested a review from amirgon March 10, 2019 17:30
@embeddedt
Copy link
Member

@amirgon Please review this, since it's your code.

@amirgon
Copy link
Collaborator

amirgon commented Mar 12, 2019

@rreilink
I understand the need for generating the same output from my Micropython binding script and your binding script.
However, this is only needed for the unification of the Python and Micropython bindings, so we could have a single script to generate them both.

Before rushing into implemeting this unified script, I think we should complete the discussion we started on lvgl/lvgl#557 and reach agreements and conclusions about how this unified script should look like and how it should work.
For that purpose I've started a discussion on lvgl/lvgl#935 (this post), let's continue there and only after everything is cleared up let's start the implementation.

@amirgon amirgon merged commit ad0405e into lvgl:master Mar 15, 2019
@rreilink
Copy link
Contributor Author

Thanks @amirgon !

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.

3 participants