typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

xml typing incomplete

Open surgura opened this issue 3 years ago • 2 comments

While using mypy wit typeshed I noticed that some xml.minidom functions return values are annotated as .... I am no guru with the typing system, but I think here it is used as a placeholder. E.g. the createDocument returns a Document instance(I validated this with the std implementation code on my side), but is annotated with an ellipsis.

Are these simply still missing or is this on purpose? Excuse me if there is a typeshed todo list somewhere that I missed.

surgura avatar Jan 10 '22 16:01 surgura

The xml stubs are indeed incomplete. The marker for a missing return type is not ..., though, but the missing -> operator. For example:

def createDocumentFragment(self): ...  # no return type
def createDocumentFragment(self) -> Whatever: ...  # with return type

Any improvements are welcome!

srittau avatar Jan 10 '22 16:01 srittau

I see, that makes sense. I can probably add typing for a few functions, but I am not very experienced with this module.

surgura avatar Jan 10 '22 16:01 surgura