Commit Graph

31 Commits

Author SHA1 Message Date
Sebastian Rittau
0501e2b329 Annotations for remaining Python 3.8 additions (#3358)
* Add os.add_dll_directory()
* Add memfd_create() and flags
* Add type annotation to flags
* Add stat_result.st_reparse_tag and flags
* Add ncurses_version
* Add Path.link_to()
* Add Picker.reducer_override()
* Add plistlib.UID
* Add has_dualstack_ipv6() and create_server()
* Add shlex.join()
* Add SSL methods and fields
* Add Python 3.8 statistics functions and classes
* Remove obsolete sys.subversion
* Add sys.unraisablehook
* Add threading.excepthook
* Add get_native_id() and Thread.native_id
* Add Python 3.8 tkinter methods
* Add CLOCK_UPTIME_RAW
* Add SupportsIndex
* Add typing.get_origin() and get_args()
* Add unicodedata.is_normalized
* Add unittest.mock.AsyncMock

Currently this is just an alias for Any like Mock and MagicMock. All of
these classes should probably be sub-classing Any and add their own
methods. See also #3224.

* Add unittest cleanup methods
* Add IsolatedAsyncioTestCase
* Add ElementTree.canonicalize() and C14NWriterTarget
* cProfile.Profile can be used as a context manager
* Add asyncio task name handling
* mmap.flush() now always returns None
* Add posonlyargcount to CodeType
2019-10-14 09:53:48 +02:00
Sebastian Rittau
6507875f28 Annotate Python 3.8 removals (#3359)
* macpath
* time.clock()
* Some cgi functions
* XMLParser(html) and doctype()
* unicode_internal
* Two sqlite3 classes hidden
* fileinput bufsize arg
* Treeview.selection no longer takes arguments
2019-10-14 09:51:39 +02:00
Guido van Rossum
b336182b69 Fix some errors with --disallow-any-generics (#3276)
See #3267. Covers all of stdlib/2and3.
2019-09-29 09:15:27 -07:00
Sebastian Rittau
628eee29f7 Use Literal in a few more places (#3176) 2019-08-10 13:08:18 -07:00
Michael R. Shannon
568f1ea555 Add attributes to xml.etree.ElementTree.ParseError. (#3158) 2019-07-30 08:48:28 +02:00
Ran Benita
c9f9530224 xml.etree.ElementTree: use literal type for a more precise return value for tostring() (#3120) 2019-07-25 09:31:12 +02:00
Ran Benita
c66699800e xml.etree.ElementTree: fix missing None in get(), findtext() return type (#3093) 2019-07-01 14:28:40 +02:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
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