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

2010-04-04 Thread Chris Rebert
Ah, (bleep). Disregard both my responses. Darn headache. Cheers, Chris -- Definitely going to bed now. http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

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

2010-04-04 Thread Chris Rebert
> 2010/4/4 Chris Rebert >> >> On Sun, Apr 4, 2010 at 1:42 AM, catalinf...@gmail.com >> 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, t

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, catalinf...@gmail.com > wrote: > > Hi everyone . > >

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

2010-04-04 Thread Paul McGuire
On Apr 4, 3:42 am, "catalinf...@gmail.com" wrote: > Hi everyone . > My questions is "why vars().has_key('b') is False ?' > I expecting to see "True" because is a variable ... > Thanks Yes, 'b' is a var, but only within the scope of something(). See how this is different: >>> def sth(): ... b

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

2010-04-04 Thread Chris Rebert
On Sun, Apr 4, 2010 at 1:42 AM, catalinf...@gmail.com 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/na

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

2010-04-04 Thread catalinf...@gmail.com
Hi everyone . My questions is "why vars().has_key('b') is False ?' I expecting to see "True" because is a variable ... Thanks Please see code bellow . >>> x=11 >>> def something(): ... b=25 ... >>> vars().has_key('x') True >>> vars().has_key('b') False >>> globals().has_key('x') True >>> global