1.1 --- a/translator.py Mon Nov 28 01:00:10 2016 +0100
1.2 +++ b/translator.py Mon Nov 28 15:30:52 2016 +0100
1.3 @@ -306,7 +306,7 @@
1.4 "Return whether 'path' is a method."
1.5
1.6 class_name, method_name = path.rsplit(".", 1)
1.7 - return self.importer.classes.has_key(class_name) and class_name
1.8 + return self.importer.classes.has_key(class_name) and class_name or None
1.9
1.10 def in_method(self):
1.11
1.12 @@ -890,8 +890,12 @@
1.13 if self.in_conditional or self.in_function:
1.14 self.process_assignment_for_function(original_name, compiler.ast.Name(name))
1.15 elif not ref.static():
1.16 + context = self.is_method(objpath)
1.17 +
1.18 self.process_assignment_for_function(original_name,
1.19 - make_expression("((__attr) {0, &%s})" % encode_path(objpath)))
1.20 + make_expression("((__attr) {%s, &%s})" % (
1.21 + context and "&%s" % encode_path(context) or "0",
1.22 + encode_path(objpath))))
1.23
1.24 def process_function_defaults(self, n, name, instance_name):
1.25