[Cython] Status

John Skaller2 skaller at internode.on.net
Fri Jan 31 06:34:06 EST 2020


>>>> 	ob should be PyObject*
>>> 
>>> No, the declaration looks correct to me. The input is an object.
>> I don’t understand. ob isn’t a type, is it? A type is required.
> 
> It's a (dummy) parameter name. Cython defaults to "object" when a
> type isn't specified.
> 
> Looking at the other declarations in that file, it was probably
> *meant* to say "object ob", but it's not wrong -- it still works
> that way.

Ok, but now the syntax is made very context sensitive.
To interpret it correctly, you have to know “ob” is not a type.
And the Python docs make exactly the same mistake.
In C this would not work because there is no default type,
so the Python docs are wrong because they’re supposedly
documenting C. [The only case it could be correct would
be if the symbol were a macro]

And my translator script got fooled, because it assumes
any single identifier used as a parameter is a type,
and if two words are used, the first is a type and the second
can be discarded, except in the special case “unsigned int”.

Note, I’m just trying to help by bringing up inconsistencies,
which are things my simplistic translator script can’t handle.

—
John Skaller
skaller at internode.on.net







More information about the cython-devel mailing list