Re: vars().has_key() question about how working .

2010-04-04 Thread Cata
So is not possible to testing if a variable is defined with this functions
vars(), globals(), locals() ?
Or maybe i make confusion with another issue.
Please more specific ... Thank you

2010/4/4 Chris Rebert 

> On Sun, Apr 4, 2010 at 1:42 AM, [email protected]
>  wrote:
> > Hi everyone .
> > My questions is "why vars().has_key('b') is False ?'
> > I expecting to see "True" because is a variable ...
>
> The built-in constants and functions aren't global variables, they're
> in the special __builtins__ dictionary/namespace, and thus not part of
> globals() or vars().
>
> Cheers,
> Chris
> --
> http://blog.rebertia.com
>
-- 
http://mail.python.org/mailman/listinfo/python-list


How is correct use of eval()

2010-10-11 Thread Cata
Hi .
I read about eval().
I also read about this "bug" :
cod = raw_input ('Enter:")
eval (cod)
if i use  "rm -rf ~"  all files will be deleted .

What is correct way to use this function?
Thank's
-- 
http://mail.python.org/mailman/listinfo/python-list