From: Dag Sverre Seljebotn Date: Tue, 20 Oct 2009 08:37:13 +0000 (+0200) Subject: Blacklist __nonzero__ from autotestdict X-Git-Tag: 0.13.beta0~2^2~121^2~3^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=35e28a5e9f81eb7f124313055c573c58a31f6790;p=cython.git Blacklist __nonzero__ from autotestdict --- diff --git a/Cython/Compiler/AnalysedTreeTransforms.py b/Cython/Compiler/AnalysedTreeTransforms.py index 933250c6..300aebbc 100644 --- a/Cython/Compiler/AnalysedTreeTransforms.py +++ b/Cython/Compiler/AnalysedTreeTransforms.py @@ -10,7 +10,7 @@ import Naming class AutoTestDictTransform(ScopeTrackingTransform): # Handles autotestdict directive - blacklist = ['__cinit__', '__dealloc__', '__richcmp__'] + blacklist = ['__cinit__', '__dealloc__', '__richcmp__', '__nonzero__'] def visit_ModuleNode(self, node): self.scope_type = 'module' diff --git a/tests/run/autotestdict.pyx b/tests/run/autotestdict.pyx index bc1f7fc0..e4f47a44 100644 --- a/tests/run/autotestdict.pyx +++ b/tests/run/autotestdict.pyx @@ -102,5 +102,12 @@ cdef class MyCdefClass: False """ + def __nonzero__(self): + """ + Should not be included, as it can't be looked up with getattr in Py 3.1 + + >>> True + False + """