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

_parameters deleted in wrong order #354

Open
geoskd opened this issue Sep 28, 2023 · 0 comments
Open

_parameters deleted in wrong order #354

geoskd opened this issue Sep 28, 2023 · 0 comments

Comments

@geoskd
Copy link

geoskd commented Sep 28, 2023

for i in to_delete:

This list is not deliberately ordered and if the indexes are not stored in to_delete[] in reverse order, the del operation on line 502 will have unexpected results.

The simplest fix is to insert "to_delete.sort(reverse=True)" between the two for loops as follows:

        for parameter in element_class.positional_parameters.values():
            if parameter.key_parameter:
                i = parameter.position
                self._dict_parameters[parameter.attribute_name] = self._parameters[i]
                to_delete.append(i)
        to_delete.sort(reverse=True)
        for i in to_delete:
            del self._parameters[i]
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

No branches or pull requests

1 participant