May-23-2024, 05:35 PM
(May-23-2024, 05:25 PM)deanhystad Wrote: Could you please post the code that makes the dictionaries. There is no reason the result needs to look as it does. As I said, there is nothing in defaultdict that results in the dictionary you are getting, it is how your code is using the defaultdict that makes them that way. I don't see any way that you can blame this on a defaultdict.
{'SAG01112_SSAP_HA_LPM': [['OS_TYPE', 'AIX'], ['IS_COBOL', '1']]}Should it be this?
{'SAG01112_SSAP_HA_LPM': {OS_TYPE': 'AIX', 'IS_COBOL': '1'}}
nothing special...defaultdict is initialized with the list factory and lists with gathered values are appended during script runtime.
my_dict = defaultdict(list)list is required because keys are not guearanteed unique