1.1 --- a/inspector.py Sun Feb 12 23:24:42 2017 +0100
1.2 +++ b/inspector.py Mon Feb 13 15:35:36 2017 +0100
1.3 @@ -521,14 +521,17 @@
1.4 # class. Function instances provide these attributes.
1.5
1.6 if class_name != "__builtins__.core.function":
1.7 +
1.8 self.set_name("__fn__") # special instantiator attribute
1.9 self.set_name("__args__") # special instantiator attribute
1.10
1.11 - # Provide leafname and parent attributes.
1.12 + # Provide leafname, parent and context attributes.
1.13
1.14 parent, leafname = class_name.rsplit(".", 1)
1.15 self.set_name("__name__", self.get_constant("string", leafname).reference())
1.16 - self.set_name("__parent__")
1.17 +
1.18 + if class_name != "__builtins__.core.function":
1.19 + self.set_name("__parent__")
1.20
1.21 self.process_structure_node(n.code)
1.22 self.exit_namespace()