Convert set to list

Rob Gaddi rgaddi at highlandtechnology.invalid
Thu Mar 31 20:06:35 EDT 2016


Larry Martell wrote:

> I feel like I've converted sets to lists before. But maybe not. Or
> maybe I am losing it from having worked 70 hours this week.
>
> Shouldn't this work?
>
> (Pdb) print block['relative_chart1']['vessel_names']
> set([u'Common Carotid', u'External Carotid', u'Internal Carotid'])
> (Pdb) type(block['relative_chart1']['vessel_names'])
> <type 'set'>
> (Pdb) list(block['relative_chart1']['vessel_names'])
> *** Error in argument: "(block['relative_chart1']['vessel_names'])"

Pdb takes the "list" command as a request to list source code.

print list(block['relative_chart1']['vessel_names']) should work.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.



More information about the Python-list mailing list