Skip to content Skip to sidebar Skip to footer
Showing posts with the label Locals

How To Dynamically Modify A Function's Local Namespace?

NB: This question assumes Python 2.7.3. I'm looking for a sane approach to dynamically modify a… Read more How To Dynamically Modify A Function's Local Namespace?

Python Scoping In Dict Comprehension

>>> x = 'foo' >>> {0: locals().get('x')} {0: 'foo'} >&… Read more Python Scoping In Dict Comprehension