Shadow Detection?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Yanowitz

    #1

    Shadow Detection?

    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:

Working...