Skip to content

Problems with "from xyz import *" #2621

@AlexanderZvyagin

Description

@AlexanderZvyagin

I have a problem with the following code:

from libc.math cimport NAN

# The file "empty.py" is really empty!!! 
# no problem, if the next line is commented out
from empty import *

cpdef float f():
    return NAN

And the compilation error message is:

cmsam/t.cpp: In function ‘int __pyx_import_star_set(PyObject*, PyObject*, char*)’:
cmsam/t.cpp:676:68: error: lvalue required as left operand of assignment
 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
                                                                    ^
cmsam/t.cpp:1071:11: note: in expansion of macro ‘__pyx_PyFloat_AsFloat’
     NAN = __pyx_PyFloat_AsFloat(o); if (unlikely((NAN == (float)-1) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L2_error)
           ^~~~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1

This is a minor problem, I can perform explicit imports (without using "*").

Cython version '0.28.5'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions