python - How to deep copy a dictionary without .deepcopy -


this question has answer here:

is there way create deep copy of dictionary without copy module? need copy dictionary of dictionaries n times, working in environment pared down jython libraries not include copy. cannot add modules system.

i convert dictionaries lists , use [:] copy, wondering if possible dictionaries.

so dictionary-inside-dictionary goes 1 level deep? if so, try:

copy = {} k, v in original.items():     copy[k] = dict(v) 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -