17 points · by twampss · 16y ago · 11 comments
How much more clearer is this code:
def some_func(someList):
for elem in someList:
# do something with elem
yield elem def post_process(data):
newdict = data.copy()
Str = 'df_use_percent'
if Str in newdict:
newdict[Str] = newdict[Str].rstrip('%')
return newdict(also, newdict = dict(data) seems more natural to me since the same idiom can be used for copying lists, which don't have a copy method).