1.1 --- a/inspector.py Thu Sep 08 23:34:23 2016 +0200
1.2 +++ b/inspector.py Thu Sep 08 23:59:54 2016 +0200
1.3 @@ -568,7 +568,16 @@
1.4
1.5 locals = self.function_locals[function_name] = {}
1.6
1.7 - for argname in argnames:
1.8 + # Define "self" in terms of the class if in a method.
1.9 + # This does not diminish the need for type-narrowing in the deducer.
1.10 +
1.11 + if argnames:
1.12 + if self.in_class and argnames[0] == "self":
1.13 + locals[argnames[0]] = Reference("<instance>", self.in_class)
1.14 + else:
1.15 + locals[argnames[0]] = Reference("<var>")
1.16 +
1.17 + for argname in argnames[1:]:
1.18 locals[argname] = Reference("<var>")
1.19
1.20 globals = self.scope_globals[function_name] = set()