◐ Shell
clean mode source ↗

Message 282861 - Python tracker

Today, writing an AC declaration like:

    something: Py_ssize_t(c_default="-1") = None

Leads to the almost obvious "Py_ssize_t_converter: default value None for field something is not of type int".

But it actually make sense: 
 - Accept None as a default python value
 - Document "something=None" in the docstring
 - Write `Py_ssize_t something = -1` in the C code
 - Don't try to parse the argument if it's the default value, keeping the value from the C initialization

In other words, it's a "Give -1 to the C implementation when argument is not given or None, and it may be usefull, typically I'll use it in issue28754.