Hello,
In the new version of python interface there is a problem:
When python dictionary converted to list of properties, this properties list has the same order as python dict props list, which is not the same as native metakit properties order. It results in unpredictable behavour of binary search if combination of sort/locate/search is used from python.
Better to return old behavour, or make apropriate changes in makeDictRow to preserv native order of properties.
Could you give a small code example of this? I'm not clear on what you are saying.
Here is what I think you are saying:
>> st = metakit.storage()
>> vw = st.getas("t[a,b,c:I,d:F]")
>> print vw.properties()
{'a': Property('S', 'a'), 'c': Property('I', 'c'), 'b': Property('S', 'b'), 'd': Property('F', 'd')}
Note that there is no ordering to a dictionary, it is undefined in the python standard. If you want to get the properties in the table creation order use:
>> print vw.structure()
[Property('S', 'a'), Property('S', 'b'), Property('I', 'c'), Property('F', 'd')]
so to extract a metakit table into a python list in native order:
props = vw.structure() table = [[getattr(row, prop.name) for prop in props] for row in vw]
# or more pedantically
table = []
for row in vw:
res = []
for prop in props:
res.append(getattr(row, prop.name))
table.append(res)This might not be what you are talking about though.
Brian
S.
_____________________________________________ Metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
_____________________________________________ Metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
