Skip to content

Interactively defined functions can't access user namespace #387

@fperez

Description

@fperez

Simple example:

In [1]: a = 10

In [2]: def f(x):
   ...:     return x+a
   ...: 

In [3]: f(1)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/etc/cups/ in ()
----> 1 f(1)

/etc/cups/ in f(x)
      1 def f(x):
----> 2     return x+a

NameError: global name 'a' is not defined

This used to work in 0.10.x, I just tested it. I haven't had time to bisect it and have to run now, but this one is absolutely a blocker, unfortunately.

Anyone who can take a stab at it, would be awesome. The first thing to do is to add a failing test for this, I can't believe we didn't have any already...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions