1.1 --- a/inspector.py Thu Sep 08 23:06:03 2016 +0200
1.2 +++ b/inspector.py Thu Sep 08 23:34:23 2016 +0200
1.3 @@ -554,9 +554,18 @@
1.4 # Initialise argument and local records.
1.5
1.6 function_name = self.get_object_path(name)
1.7 + argnames = get_argnames(n.argnames)
1.8
1.9 - argnames = self.importer.function_parameters[function_name] = \
1.10 - self.function_parameters[function_name] = get_argnames(n.argnames)
1.11 + # Insert "self" into methods where not explicitly declared.
1.12 +
1.13 + if self.in_class and (not argnames or argnames[0] != "self"):
1.14 + argnames.insert(0, "self")
1.15 +
1.16 + self.importer.function_parameters[function_name] = \
1.17 + self.function_parameters[function_name] = argnames
1.18 +
1.19 + # Define all arguments/parameters in the local namespace.
1.20 +
1.21 locals = self.function_locals[function_name] = {}
1.22
1.23 for argname in argnames: