KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do I obtain the non-local variables for the current scope? The functions vars , locals , and globals exist, but is there a function to get the nonlocals ? Why aren't the nonlocals listed when calling vars ? Update My issue is that there's no way to enumerate the variables available in the current scope, as neither vars or globals includes the non-locals AFAICT. I frequently use vars in code such as the following: '{meh[0]}/{meh[3]} {a}{b}{c}'.format(**vars()) Which fails if any of these variables are in the scope of a containing function.
Tags (comma-separated)
Save Edits
Cancel