MarcoGorelli / cython-lint

Lint Cython files
MIT License
68 stars 11 forks source link

Spurious warning with untyped multiple declarator #89

Closed dalcinl closed 8 months ago

dalcinl commented 8 months ago

Reproducer

$ echo 'cdef a, b, c' > /tmp/tmp.pyx
$ cython-lint /tmp/tmp.pyx 
/tmp/tmp.pyx:1:5: comma after base type in definition
MarcoGorelli commented 8 months ago

isn't this correct? shouldn't you set a type there, like cdef int a, b, c?

dalcinl commented 8 months ago

AFAIU, in this case Cython implicitly assumes the type is object. I have a few of these cases in mpi4py since the dawn of Cython, this probably originated in Pyrex.

dalcinl commented 8 months ago

BTW, if you point me in the right direction, maybe I would be able to sketch a PR.

MarcoGorelli commented 8 months ago

I'd rather keep this one, thanks, it's helped find some real issues. You can specify object explicitly

MarcoGorelli commented 8 months ago

closing then, but thanks for the suggestion