1. Python CFFI
  2. Untitled project
  3. cffi
Issue #60 closed

Proposed rename for verify and Verifier

Nick Coghlan
created an issue

One point raised on python-dev was that the "verification" aspect is an odd thing to focus on when naming the constructs at the API creation level. It makes sense as a contrast to the lack of type safety when using the ABI directly, but that's mostly a historical artefact of the transition from ctypes rather than being especially meaningful in the long term.

My alternate suggestion:

  • cffi.verify -> cffi.create_api
  • cffi.verifier -> cffi.api_creation
  • cffi.verifier.Verifier -> cffi.api_creation.APICreator

Comments (6)

  1. Armin Rigo

    ffi.create_api() makes sense to me. Similarly, discussed on irc: dlopen() should be renamed --- maybe for symmetry to ffi.dlopen_abi(), or to some longer name that should make it clear that, while there are valid use cases, generally speaking it's considered better (safer) to use verify()/create_api().

    Maybe ffi.dlopen_unsafe_abi()?

  2. Nick Coghlan reporter

    "dlopen_abi_raw" and "dlopen_abi_unchecked" are a couple more options for the "you're bypassing all the helpers, segfaults are probably in your future" level.

  3. Armin Rigo

    The "verifier" disappeared from the radar in cffi 1.0. ffi.dlopen() is still there, but I don't know how I can meaningfully rename that method at this point without all users complaining. Closing this issue.

  4. Nick Coghlan reporter

    Sounds good to me - I think dlopen is sufficiently low level in and of itself that most folks are likely to avoid it if they can use something higher level.

  5. Log in to comment