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

Review the generator python code #292

Closed
tmadlener opened this issue May 30, 2022 · 0 comments · Fixed by #293
Closed

Review the generator python code #292

tmadlener opened this issue May 30, 2022 · 0 comments · Fixed by #293

Comments

@tmadlener
Copy link
Collaborator

tmadlener commented May 30, 2022

In the python generator code there are still quite a few places that were originally put in place for being compatible with python2 and python3, e.g.:

from __future__ import absolute_import, unicode_literals, print_function

There are also a few compatibility imports here:

# collections.abc not available for python2, so again some special care here

Additionally, the specific function for the ordered loading of the yaml file should be obsolete with python >= 3.7 (and in principle also already with python >= 3.6, though not yet guaranteed). Additionally, I think we no longer explicitly depend on the datatypes being in the same order as they appear in the yaml file:

def ordered_load(stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict): # pylint: disable=invalid-name

Since python2 support has been dropped some time ago (see #207 for a few more details), we could also clean up the generator code a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant