/home/smarchi/src/babeltrace/src/bindings/python/bt2/bt2/field_class.py:48:16 - error: Expression of type "staticmethod[(field_class: Unknown), Unknown]" cannot be assigned to declared type "(ptr: Unknown) -> Unknown" Type "staticmethod[(field_class: Unknown), Unknown]" cannot be assigned to type "(ptr: Unknown) -> Unknown" Parameter name mismatch: "ptr" versus "field_class" (reportGeneralTypeIssues)
/home/smarchi/src/babeltrace/src/bindings/python/bt2/bt2/field_class.py:49:16 - error: Expression of type "staticmethod[(field_class: Unknown), Unknown]" cannot be assigned to declared type "(ptr: Unknown) -> Unknown" Type "staticmethod[(field_class: Unknown), Unknown]" cannot be assigned to type "(ptr: Unknown) -> Unknown" Parameter name mismatch: "ptr" versus "field_class" (reportGeneralTypeIssues)
So, it's just the parameter name that it doesn't like. The obvious solution would be to rename the `ptr` parameters of _SharedObject._{get,put}_ref to `field_class`, in _SharedObject, to match the names in native_bt.py. However, I don't want us to be tied to the names in native_bt.py (which originally come from the C header files), as in Python we often want to use `ptr` in the name to differentiate the SWIG wrapper around the pointer and the higher-level. Another solution might be to use SWIG code to rename function parameters in the SWIG-generated code, but I'm not so well-versed in SWIG, I couldn't find how to do that.
So, I propose to just use the standard syntax for methods instead, the type checker seems to be happy with that.
Change-Id: Ife5ad007aea4fb315d3ff4f8da67c48f4bf3e96d Signed-off-by: Simon Marchi <simon.marchi@efficios.com> Reviewed-on: https://review.lttng.org/c/babeltrace/+/10240 Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>