The cimport
statement is a statement of Cython that is used in a definition file (*.pxd
) or in an implementation file (*.pyx
) file in order to access identifiers that are declared in another definition file (*.pxd
).
The form of a cimport
statement is analogous to Python import
statements:
cimport module
cimport package.module
cimport package.module as name
from module cimport name
from module cimport name as other_name
from package cimport module
from package cimport module as other_name
from package.module cimport name
from package.module cimport name as other_name
as well as variants of these forms with commas, for example:
from module import name_1 as other_name_1, name_2, name_3