-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I still think there is no real good use case for this collection. Basically you are re-implementing some of the existing functionality of a simple container in python (list, dict) plus some methods that I am not sure will be used - e.g. will you ever play with a list of replicas and remove from it a Replica object? Very unlikely, mainly because a replica either is there in iRODS or not. And this container reflect what is in iRODS more or less, can't modify what is in iRODS.
Also for get_out_of_date(0) method - if you were to use a plain list, to check whether all objects in a list have 1 attribute set to True/False is just 1 operation that the client can perform easily like:
out_of_date = [replica if not replica.up_to_date for replica in replicas]
I also can't think of a good use case for keeping it as a dict...it's not like you have an array of 1000 replicas in which you need to find quickly something by id. You will always have 1 or 2 replicas for a data object...it looks a bit like an overkill to keep all these methods for a container with at most 2 elements.