Skip to content

Commit

Permalink
Merge pull request #74 from has2k1/fix-eval-namespace-doc
Browse files Browse the repository at this point in the history
[doc] How to access the EvalEnviroment namespace
  • Loading branch information
njsmith committed Oct 9, 2015
2 parents 870d680 + 43ec49e commit 0c06192
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patsy/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ def capture(cls, eval_env=0, reference=0):
x = 1
this_env = EvalEnvironment.capture()
assert this_env["x"] == 1
assert this_env.namespace["x"] == 1
def child_func():
return EvalEnvironment.capture(1)
this_env_from_child = child_func()
assert this_env_from_child["x"] == 1
assert this_env_from_child.namespace["x"] == 1
Example::
Expand Down

0 comments on commit 0c06192

Please sign in to comment.