p = subprocess.Popen('declare -f ' + var, shell=True, stdout=subprocess.
    PIPE, stderr=subprocess.PIPE)
Is there a way in Python to check whether an entry to os.environ is a variable or a shell function?