Opened 3 years ago

Closed 23 months ago

#762 closed defect (fixed)

crash in type inference when accessing Python attribute of C double

Reported by: scoder Owned by: somebody
Priority: major Milestone: 0.18
Component: Type Analysis Keywords:
Cc:

Description

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.

Change History (1)

comment:1 Changed 23 months ago by scoder

  • Milestone changed from wishlist to 0.18
  • Resolution set to fixed
  • Status changed from new to closed

Seems to work now.

Note: See TracTickets for help on using tickets.