I have a treant with a lot of data entries called run-* and some others with different names. To get only the one with run-* I currently have to create a list with the keys I like and then iterate over the list of keys.
run_data = (k for k in t.data.keys() if k.startswith('run-'))
for k in run_data:
data = t.data[k]
pass
It would be more convenient if I could do
for data in t.data['run-*']:
pass
I'm not to sure about the syntax here though. It would also mean we allow general regex in the getitem method. But also keep in mind that in over a year of using the library this is the first time I wanted to do something like this.
I have a treant with a lot of data entries called
run-*
and some others with different names. To get only the one withrun-*
I currently have to create a list with the keys I like and then iterate over the list of keys.It would be more convenient if I could do
I'm not to sure about the syntax here though. It would also mean we allow general regex in the getitem method. But also keep in mind that in over a year of using the library this is the first time I wanted to do something like this.