Shadow Detection?

Michael Yanowitz m.yanowitz at
Tue May 9 22:14:30 CEST 2006


  Many times, people are warning things like
"Don't use 'str' as a variable name as it will shadow the
built in str function." 
   Is there some way to determine if a string is already
defined in some higher scope?
Maybe something like

if isdefined ('str'):
   print 'str is already defined, please choose another name'


  If not, would it be easy to write this?

Thanks in advance:

More information about the Python-list mailing list