lxml / lxml-stubs

Type stubs for the lxml package
Other
43 stars 28 forks source link

Implement lxml.builder, fixes #30 #52

Closed abelcheung closed 2 years ago

abelcheung commented 2 years ago

Sorry, I failed to deliver stuff promised; all attempts to write generic mapping-like protocol or type specific protocol fall flat on my face. Maybe mapping would support covariant keys in future, or I can come up with something useful in future, who knows.

JelleZijlstra commented 2 years ago

That's a shame. Maybe just start with Mapping[Any, ...] so you don't have to worry about key type invariance for now, and defer a more precise type for later. It's better to have incomplete stubs than no stubs at all.

scoder commented 2 years ago

See #29. I think we can get away with replacing _AnyStr by just str.