I found the following lines in the scikit-learn package:
if is_sparse:
problem = csr_set_problem(
(
That is Cython's syntax for type casting/coercion. It is not plain Python. Notice the file extension is .pyx
You can learn more about them in the documentation for Cython.
Here's an example taken from the doc page:
cdef char *p, float *q
p = q
Using Cython is not uncommon with projects like scikit-learn
, where one gains significant optimisations by mixing readable Python with blazing-speed C.