Skip to content

NSMapArg type definition is incorrect. #76

@dapper91

Description

@dapper91

nsmap argument of Element function is of type Optional[_NSMapArg] where _NSMapArg is Mapping[str, str].

But according to the documentation here namespace key for the default namespace supposed to be None:

...
>>> NSMAP = {None : XHTML_NAMESPACE} # the default namespace (no prefix)

>>> xhtml = etree.Element(XHTML + "html", nsmap=NSMAP) # lxml only!
...

So it seems like _NSMapArg should be Mapping[Optional[str], str]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions