It should be possible to ask for every object whether it looks like
an element. If only Elements are accepted, this function would always
return True.
Fixes#2629
* Have Element inherit from MutableSequence, which is more precise than Sequence.
* Remove unnecessary inherited methods (e.g., __getitem__).
* Correct extend() to take an Iterable. (Sequence was too specific.)
* Alphabetize the typing imports, for sanity.
- Removed class definitions from `xml/__init__.pyi` as they were merely outdated duplicates of the definitions from the correct file (`xml/sax/__init__.pyi`)
- Left file intact as it is necessary for the module
- Updates documentation related to previously required comment headers.
- Removes all comment headers from stubs
- Occasionally included a header for stubs that were noted to be incomplete or contained todo's.
* Improve types for xml.etree.ElementTree
Update signatures to reflect the following peculiarities of the
ElementTree library:
- The elementtree library accepts unicode or bytes for most xml values
in python2, and coerces everywhere -- but in python3, only str makes
sense.
- In python 2, the library produces str or unicode instances
unpredictably, depending on whether the xml is decodeable as ascii or
not. In python 3, it always produces str instances.
- The parser functions accept unicode or bytes in 2 and 3 -- again, will
coerce individual instances so heterogeneous lists are ok.
- In python 3, the tostring functions produce bytes or str, depending on
the value of the 'encoding' parameter.
* improve docs
* Improve ElementFactory type by specifying dict of 2nd arg