2 May
2016
2 May
'16
5:55 a.m.
Joshua Morton wrote:
import math with Namespace(math): print(pi**2)
That can't work if pi isn't assigned to as a local somewhere else in the function, because the compiler won't have allocated it a slot in locals for Namespace to modify.
with Namespace(m=math):` print(m.pi**2)
I don't see how that's any better than m = math print(m.pi**2) -- Greg