Skip to content

Missing type hints for optional parameters in xmlsec.template.create() #368

Description

@granteckels

When using PyLance or other type checkers, the function xmlsec.template.create reports errors such as

  • "No parameter named ns"
  • "No parameter named id"

However, according to the official documentation and the module’s C-level docstring, create supports optional id and ns parameters. This is in line 607 of src/template.c.

"encrypted_data_create(node, method, id = None, type = None, mime_type = None, encoding = None, ns = None) -> lxml.etree._Element\n"

But the typed function signature is

def create(node: _Element, c14n_method: Transform, sign_method: Transform) -> _Element: ...

Can these type hints be added? Or should I just quickly change it and make a pull request? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions