From ac4fb25d092f6ecde16bff926210f4dd78161019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Thu, 8 Nov 2018 23:23:53 +0100 Subject: [PATCH] Use getattr to avoid problems with partials/lambda --- pyknow/agenda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyknow/agenda.py b/pyknow/agenda.py index d4a09ee..5f4ab24 100644 --- a/pyknow/agenda.py +++ b/pyknow/agenda.py @@ -15,7 +15,7 @@ def __init__(self): def __repr__(self): # pragma: no cover return "\n".join( "{idx}: {rule} {facts}".format(idx=idx, - rule=act.activation.rule.__name__, + rule=getattr(act.activation.rule, '__name__', '[anonymous]'), facts=act.activation.facts) for idx, act in enumerate(self.activations))