Sep-05-2020, 10:26 PM
in a function i am doing a return of the locals() dictionary. one of the values i want to include in that dictionary is in the global space (let's call it "foo"). so i was, at first, tempted to just code
i figure what i should do is:
foo = foo
which i presume would not work. what would be the appropriate way put a variable in that function's local name space, taking its value from the same name in the global name space.i figure what i should do is:
d = locals() d['foo'] = foo return dbut this has got me curious if there is a direct one expression way to do that (in or before a return statement).
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.