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

Avoid storing ListProxy in *FileSelector #825

Merged
merged 1 commit into from Aug 29, 2023
Merged

Conversation

jbednar
Copy link
Member

@jbednar jbednar commented Aug 29, 2023

FileSelector and MultiFileSelector have logic to compute a list of objects from the files on a file system, which they then pass into their Selector superclass as if it had been provided in the constructor. Probably from not being updated when ListProxy was added and objects became a property, what ended up being passed to the superclass was a ListProxy, which the superclass then dutifully stored into the _objects attribute behind the objects property. The result was that these two classes ended up with a ListProxy of a ListProxy of a list, which is surely not what was intended. This PR passes the _objects list to the superclass as I believe was intended. The filenames are a plain list, not a dictionary, so the names portion of the property that's used by ListProxy isn't needed.

The tests pass locally before and after this change, and some other work I was doing avoids weird recursion errors as a result, but it's not something really worth putting into the tests since storing a ListProxy would be a weird thing for normal code to do.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@maximlt maximlt merged commit 117a4ab into main Aug 29, 2023
10 checks passed
@maximlt maximlt deleted the listproxyrecursion branch August 29, 2023 08:55
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.

None yet

3 participants