I have a slightly strange problem with sorting in a python script. Basically, sorting by title and meta_type both work as expected, but by id produces totally random results that I cannot fathom (I really can't see any pattern at all). Here is the code snippet ------------------------ def sort_id(ob1, ob2): return cmp(ob1.id, ob2.id) def sort_title(ob1, ob2): return cmp(ob1.title, ob2.title) def sort_meta(ob1, ob2): return cmp(ob1.meta_type, ob2.meta_type) if context.REQUEST.has_key('sort'): obVals = context.objectValues(all_types) obVals.sort(sort_id) if context.REQUEST['sort'] == 'title': obVals.sort(sort_title) elif context.REQUEST['sort'] == 'object_type': obVals.sort(sort_meta) -------------------------- I have also tried: getattr(ob1, 'id') - which gives the same wierd results ob1.id() - which gives a TypeError of 'call of non-function (type string)' I copied this approach from Chris McD's post here (http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/19E1DED84C7E413F). Can anyone tell me why the id sort goes so crazy? Thanks tim tim at sitefusion dot co dot uk