pyobjc icon indicating copy to clipboard operation
pyobjc copied to clipboard

Investigate tooling to check CPython API use

Open ronaldoussoren opened this issue 4 years ago • 0 comments

CPython API misuse can be hard to diagnose, especially reference counting. problems and forgetting to clear errors.

Investigate using (custom?) tooling to automate checking:

  • Using annotations to document expected reference count behaviour, with tooling to verify this (compare how clang's static analyzer does this for ObjC retain counts)
  • Use annotations to mark which functions can return with an active exception and use tooling to check error propagation/clearing.

With some luck someone has written tooling for this, otherwise the most complete fix is likely a plugin for the clang static analyzer (which is a lot of work...)

ronaldoussoren avatar Mar 11 '22 12:03 ronaldoussoren