Commit Graph

23 Commits

Author SHA1 Message Date
Michael R. Shannon
a2ecfafa98 Add missing explicit Optional to stubs for the xml.etree package. (#2734)
Fixes #2733
2019-01-17 13:50:37 +01:00
Sebastian Rittau
ece96777a7 Re-export pyexpat instead of using check_consistency (#2649) 2018-11-29 07:29:59 -08:00
Maarten ter Huurne
eaae246062 Change argument type for xml.etree.ElementTree.iselement() to object (#2642)
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
2018-11-28 02:34:27 +01:00
Sebastian Rittau
006a79220f Flake8 fixes (#2549)
* Fix over-indented continuation lines

* Fix under-indented continuation lines

* Fix whitespace around default operator problems

* Limit line lengths

* Fix inconsistent files
2018-10-24 07:20:53 -07:00
Michael R. Crusoe
2e0af18dda slices of MutableSequences are also MutableSequences (#2428) 2018-09-25 13:06:59 -07:00
Martin DeMello
0c9f0d21d2 allow for unicode entity dicts in saxutils (#2345) 2018-07-24 11:18:23 -07:00
Yusuke Miyazaki
6192cce9d9 Avoid using string literals in type annotations (#2294) 2018-07-02 20:23:29 -07:00
Sebastian Rittau
7ebd609643 Add pyexpat and xml.parsers (#2276) 2018-06-28 10:26:17 -07:00
rchen152
38dc8f5a6a Switch usages of mypy_extensions.NoReturn over to typing.NoReturn. (#1942)
* Change mypy_extensions.NoReturn to typing.NoReturn everywhere.
2018-03-05 12:42:29 -08:00
Roy Williams
a618ee30d4 Fix instantiating a xml.etree.ElementTree.Element (#1930)
The methods removed by https://github.com/python/typeshed/pull/1816
are abstract in `MutableSequence` and therefore must be specified on `Element`.
2018-02-27 14:59:11 -08:00
rchen152
db6e2a637b Fix some bugs in xml.etree.ElementTree.Element's container behavior. (#1816)
* 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.
2018-01-04 19:04:46 -08:00
Sally
37f1bf54a5 Fix type of source for xml.sax.parse (#1666)
Fixes https://github.com/python/typeshed/issues/1655
2017-10-25 09:45:48 -07:00
Gábor Bernát
f1a01b3017 [XML] iterparse is None for end-ns, Tuple[str, str] for start-ns, Element otherwise (#1520) 2017-10-04 08:24:27 -07:00
Jelle Zijlstra
fee2eaae30 xml.sax.saxutils: make some functions take AnyStr (#1457)
Fixes #1062
2017-07-04 19:18:43 -07:00
Matěj Cepl
367743adf0 Python 3 adds short_empty_elements attribute to xml.sax.saxutils.XMLGenerator. (#1265)
Fix #1265
2017-05-25 08:53:01 -07:00
Emily Morehouse
efec7d67e8 Removed SAX classes from xml/__init__.pyi (#1299)
- 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
2017-05-22 16:08:08 -07:00
Emily Morehouse
b6d08b81a3 #1286 Remove header comments from stubs (#1292)
- 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.
2017-05-22 15:14:15 -07:00
Jelle Zijlstra
8f1875b97b fixes to xml.sax (#1201) 2017-04-24 15:03:07 -07:00
lincolnq
59789b8a3e Improve types for xml.etree.ElementTree (#930)
* 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
2017-02-22 20:43:09 -08:00
Valérian Rousset
fe15d91041 merge */xml/etree into 2and3/xml/etree (#899)
Fixes #287.
2017-01-30 13:19:28 -08:00
Lukasz Langa
5f416fae64 Add missing List imports. 2016-12-21 01:06:52 -08:00
Lukasz Langa
fe0e3744cc Fixing flake8 E261 errors 2016-12-19 22:09:35 -08:00
Matthias Kramm
7d80824092 Better definition for xml/sax/__init__.pyi. (#621)
Also, merge 2.7/xml/sax and 3/xml/sax into 2and3/xml/sax.
2016-10-19 15:30:25 -07:00