From 7516e6d800ab21bbe4d94116247d0dd91342b484 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 30 Jan 2017 10:25:11 +0000 Subject: [PATCH] Fix 2f37b1d. --- artiq/compiler/embedding.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/embedding.py b/artiq/compiler/embedding.py index af3facc6e..a660becc8 100644 --- a/artiq/compiler/embedding.py +++ b/artiq/compiler/embedding.py @@ -564,8 +564,10 @@ class StitchingInferencer(Inferencer): if (inspect.ismethod(attr_value) and types.is_instance(object_type) and # Check that the method is indeed defined on the class, - # and not just this instance. - hasattr(type(attr_value), attr_name)): + # and not just this instance. The check is written in + # the inverted form and not as hasattr(type(attr_value)) + # since the method may as well be defined on a superclass. + attr_name not in object_value.__dict__): # In cases like: # class c: # @kernel