So, because the results in sstp were duplicates ( ['prescriptions', 'prescriptions'] ) it only returned one result in the dict(zip()) statement. Weird. Bug or feature? ;) Thanks, V
On Fri, Oct 9, 2009 at 12:37 PM, Stephen Hansen <apt.shan...@gmail.com>wrote: > > > Changing the line: >> subtypes = dict(zip(sstp, sst)) >> to: >> subtypes = dict(zip(sst, sstp)) >> as I believe Stephen misread it to be causes the zip operation to return: >> [('doctors', 'prescriptions'), ('patient', 'prescriptions')] >> and thus the dict will contain: >> {'patient': 'prescriptions', 'doctors': 'prescriptions'} >> >> > Whoops! You're absolutely right. I totally flipped the options to zip in my > head when eyeing it. I suppose I'm suffering from late-onset dyslexia. Ahem. > > Yeah, I think the arguments to zip() were probably just flipped in Victor's > code. Unless he wants a result different then what I assume is expected. I > assume he's expecting {"doctors": "prescriptions", "patient": > "prescriptions"}. If instead its something more like {"prescriptions": > ["doctors", "patient"]} then zip() isn't how to accomplish it. > > --S >
-- http://mail.python.org/mailman/listinfo/python-list