Skip to content

cffi: FFI.string invalid signature #9735

Closed

Description

@senyai

def string(self, cdata: CData, maxlen: int = ...) -> bytes | str: ...

I know that maxlen agument is optional.

Activity

  1. senyai commented on Feb 14, 2023

    @senyai
    Author

    After installing python -m pip install types-cffi --user (1.15.1.15) I got this file structure in site-packages:

    types_cffi-1.15.1.5.dist-info/INSTALLER
    types_cffi-1.15.1.5.dist-info/WHEEL
    types_cffi-1.15.1.5.dist-info/METADATA
    types_cffi-1.15.1.5.dist-info/top_level.txt
    types_cffi-1.15.1.5.dist-info/REQUESTED
    _cffi_backend-stubs/__init__.pyi
    _cffi_backend-stubs/METADATA.toml
    cffi-stubs/recompiler.pyi
    cffi-stubs/error.pyi
    cffi-stubs/__init__.pyi
    cffi-stubs/lock.pyi
    cffi-stubs/ffiplatform.pyi
    cffi-stubs/vengine_gen.pyi
    cffi-stubs/model.pyi
    cffi-stubs/cparser.pyi
    cffi-stubs/api.pyi
    cffi-stubs/commontypes.pyi
    cffi-stubs/cffi_opcode.pyi
    cffi-stubs/backend_ctypes.pyi
    cffi-stubs/setuptools_ext.pyi
    cffi-stubs/vengine_cpy.pyi
    cffi-stubs/verifier.pyi
    cffi-stubs/pkgconfig.pyi
    cffi-stubs/METADATA.toml
    

    where cffi-stubs/api.pyi has the right signature and _cffi_backend-stubs/__init__.pyi has the wrong one: def string(self, cdata: CData, maxlen: int) -> bytes | str: ... What is going on?

  2. srittau commented on Feb 15, 2023

    @srittau
    Collaborator

    This looks to be a bug in stubs/cffi/_cffi_backend.pyi. PR welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions