holoviz / param

Param: Make your Python code clearer and more reliable by declaring Parameters
https://param.holoviz.org
BSD 3-Clause "New" or "Revised" License
412 stars 69 forks source link

Avoid storing ListProxy in *FileSelector #825

Closed jbednar closed 10 months ago

jbednar commented 10 months ago

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.