Re: getattr from local scope

2006-04-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I know I can use eval, but I've always been told that if you're using > eval, you're doing it wrong. Also not using eval limits the scope damage > that can be caused by any errors in my application which could cause > the database to be poisoned. a more robust approach

Re: getattr from local scope

2006-04-23 Thread Edward Elliott
Alex Martelli wrote: > sys.modules[__name__].__dict__ may be more handily accessed by the > built-in function globals(). Well there you go. Glad it's not that awkward. -- http://mail.python.org/mailman/listinfo/python-list

Re: getattr from local scope

2006-04-23 Thread Alex Martelli
Edward Elliott <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Basically my application has a scheduler which stores names of functions > > defined in the "schedule" module in a database, to be run on certain > > days. Every night I call schedule.RunSchedule, which grabs all the rows on

Re: getattr from local scope

2006-04-23 Thread Edward Elliott
[EMAIL PROTECTED] wrote: > Basically my application has a scheduler which stores names of functions > defined in the "schedule" module in a database, to be run on certain > days. Every night I call schedule.RunSchedule, which grabs all the rows on > the database that have to be run now, and I want

getattr from local scope

2006-04-23 Thread rob . haswell
Hey there My question is pretty simple - I want to use something like getattr to grab a symbol from the local scope from a string. Basically my application has a scheduler which stores names of functions defined in the "schedule" module in a database, to be run on certain days. Every night I call