Skip to content

Avoid storing ListProxy in *FileSelector - #825

Merged
maximlt merged 1 commit into
mainfrom
listproxyrecursion
Aug 29, 2023
Merged

maximlt merged 1 commit into
mainfrom
listproxyrecursion

Conversation

@jbednar

@jbednar jbednar commented Aug 29, 2023

Copy link
Copy Markdown
Member

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.

@philippjfr philippjfr left a comment

Copy link
Copy Markdown
Member

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
@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.

3 participants