Overriding a global

Roy Smith roy at panix.com
Sat Dec 10 16:10:53 EST 2011


MRAB <python at mrabarnett.plus.com> wrote:

> or use 'globals':
> 
>      def function(self):
>          logger = globals()['logger'].getChild('function')
>          logger.debug('stuff')
>          logger.debug('other stuff')

Ah-ha!  That's precisely what I was looking for.  Much appreciated.



More information about the Python-list mailing list