Reported by scoder on 29 Feb 2012 17:46 UTC
This snippet from CPython's test_types.py crashes during type inference in AttributeNode:
f = 1.1234e90
result = f.__format__('f')
The problem is that the AttributeNode tries to coerce the number to a Python object, but the NameNode doesn't know its type yet. So it crashes with
File "Cython/Compiler/ExprNodes.py", line 601, in coerce_to
src_is_py_type = src_type.is_pyobject
AttributeError: 'NoneType' object has no attribute 'is_pyobject'
In general, type inference shouldn't have this kind of side effect.
Reported by scoder on 29 Feb 2012 17:46 UTC This snippet from CPython's
test_types.py
crashes during type inference inAttributeNode
:The problem is that the
AttributeNode
tries to coerce the number to a Python object, but theNameNode
doesn't know its type yet. So it crashes withIn general, type inference shouldn't have this kind of side effect.
Migrated-From: http://trac.cython.org/ticket/762