Shadow Detection?

Michael Yanowitz m.yanowitz at kearfott.com
Tue May 9 16:14:30 EDT 2006


Hello:

  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
<code>

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

</code>

  If not, would it be easy to write this?

Thanks in advance:




More information about the Python-list mailing list