Commit Graph
31 Commits
Author SHA1 Message Date
rchen152andJelle Zijlstra e2cfc4bf0f Add private members to argparse.pyi. (#1937)
* Add _AttributeHolder and _ActionsContainer classes to argparse.

* Add Action subclasses to argparse.

* Add _UNRECOGNIZED_ARGS_ATTR, _ensure_value, _get_action_name to argparse.

* Fill in remaining _ActionsContainer attributes.

* Fill in missing argparse.ArgumentParser attributes.

* Fill in missing argparse.HelpFormatter attributes.

* Fill in remaining missing attributes on argparse classes.

* Rename TypeVar _ActionVar to _ActionT

* Add a version check for FileType attributes

* Add '# undocumented' where appropriate

* Add more # undocumented comments

* Make arguments to _ActionsContainer.add_argument more precise.
2018-04-10 20:56:49 -07:00
rchen152andGuido van Rossum eda3f36cb9 Make abc.abstractproperty a class inheriting from property. (#1964) 2018-03-15 15:59:14 -07:00
rchen152andMatthias Kramm 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
rchen152andJelle Zijlstra e1243d0103 Add missing attributes, fix some parameter types in argparse.Action. (#1907) 2018-02-28 11:20:04 -08:00
rchen152andMatthias Kramm 066c434410 Improve the unittest stubs. (#1927)
* Improvements to stdlib/2/unittest.pyi

* Adds a bunch of missing things.
* Fixes the signatures of assertRaises and failUnlessRaises.
* Corrects the name of a TestCase subclass from CallableTestCase
  to FunctionTestCase.
* Makes defaultTestLoader an instance of TestLoader, as it should
  be, rather than an alias. Based on https://docs.python.org/2/library/unittest.html and
  https://github.com/python/cpython/tree/2.7/Lib/unittest.

* Improvements to stdlib/3/unittest/__init__.pyi

* The constructor arguments to TextTestResult are all required.
* There is a module-level load_tests() function.
* removeResult() returns a bool. Based on https://docs.python.org/3/library/unittest.html and
  https://github.com/python/cpython/tree/master/Lib/unittest.
2018-02-27 06:46:10 -08:00
rchen152andŁukasz Langa 8d46ada49d Add undocumented but occasionally used attributes to inspect.pyi. (#1864)
* Add attributes not in docs to 2/inspect.pyi.
* Add attributes not in docs to 3/inspect.pyi.
* Change list to List[Any] in 2/inspect.pyi
2018-02-14 16:20:55 +00:00
rchen152andJelle Zijlstra 66e5863ead Change the return type of unittest.TestCase.fail() to NoReturn (#1843)
* Change the return type of unittest.TestCase.fail() to NoReturn

* Import mypy_extensions.NoReturn instead of typing.NoReturn
2018-01-26 14:28:37 -08:00
rchen152andMatthias Kramm 76c733dc5b Fix the return type of os.popen() (#1820) 2018-01-10 05:57:29 -08:00
rchen152andMatthias Kramm 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
rchen152andMatthias Kramm 29acda6431 Add itertools.imap signatures for more than two iterables. (#1815) 2018-01-04 19:03:41 -08:00
rchen152andMatthias Kramm af98a29823 Add __getslice__ to the Python 2 definition of mmap.mmap (#1812) 2018-01-04 16:16:00 -08:00
rchen152andMatthias Kramm 592bdcc8a6 Fix the return type of textwrap.wrap (#1813) 2018-01-04 16:15:17 -08:00
rchen152andMatthias Kramm f6b60cb3ea A couple fixes to the io stubs. (#1811)
1. The 'name' argument to FileIO.init can be either a string or an integer: https://docs.python.org/2/library/io.html#io.FileIO
2. An mmap.mmap object can be used in most places that a bytearray can: https://docs.python.org/3.5/library/mmap.html
2018-01-04 16:14:38 -08:00
rchen152andJelle Zijlstra 8753fc78df Add setUpClass and tearDownClass to unittest.TestCase in Python 2 stub (#1760) 2017-11-21 16:39:11 -08:00
rchen152andMatthias Kramm 85e75c9a6a Fix a parameter type in threading.Thread.__init__ (#1706) 2017-11-01 15:41:10 -07:00
rchen152andMatthias Kramm 3d505d0c6b Re-export exception names in exceptions.pyi (#1611) 2017-09-19 15:19:40 -07:00
rchen152andMatthias Kramm c009caf316 Make exceptions.pyi import its definitions from __builtin__.pyi (#1610)
* Make exceptions.pyi import its definitions from __builtin__.pyi

* Make ReferenceError a full class again.

* Restore blank line at EOF.
2017-09-15 14:52:54 -07:00
rchen152andMatthias Kramm 0bf2958257 Correct a typo in stdlib/2/symbol.pyi (#1607) 2017-09-14 14:33:20 -07:00
rchen152andMatthias Kramm 1dfa570cae Fix the definition of nlargest() in stdlib/2/heapq.pyi (#1601)
* Fix nlargest() in stdlib/2/heapq.pyi

* Fix nlargest() syntax

* key can be None in heapq.nlargest
2017-09-12 08:27:41 -07:00
rchen152andJelle Zijlstra fd8be43044 Fix the return type of functools.update_wrapper() (#1589) 2017-09-05 20:03:51 -07:00
rchen152andMatthias Kramm 8d5a233c6b Fix the definition of itertools.tee() (#1584) 2017-09-05 16:21:14 -07:00
rchen152andMatthias Kramm 643aedea1b Fix the definition of LockType.__exit__. (#1485) 2017-07-13 17:30:51 -07:00
rchen152andMatthias Kramm 6368baf42a Remove duplicate names from posixpath.pyi. (#1468)
posixpath.pyi did a '*' import of genericpath.pyi and then redefined
everything it imported. Removes the duplicate definitions from posixpath
and improves the ones in genericpath.
2017-07-06 14:22:18 -07:00
rchen152andMatthias Kramm 945527dbc0 Add a __new__ method to datetime.datetime. (#1417) 2017-06-19 17:05:34 -07:00
rchen152andGuido van Rossum 16ec7cbdf0 Add __new__ to time.struct_time (#1394)
This is needed because otherwise pytype uses the `__new__` inherited from the `NamedTuple` base class.
2017-06-06 15:36:01 -07:00
rchen152andMatthias Kramm 2161f72990 time.mktime can take a struct_time or a tuple. (#1380) 2017-06-01 17:37:13 -07:00
rchen152andMatthias Kramm 2c54640dce Remove types.pyi from the pytype blacklist. (#1162)
* Fix a few return types in stdlib/2/inspect.pyi.

* Rename _FrameRecord to _FrameInfo

* Correct some return types in itertools.pyi from Iterable to Iterator.

* Change types.pyi syntax that pytype can't parse.

* Remove types.pyi from the pytype blacklist.
2017-04-14 15:14:20 -07:00
rchen152andMatthias Kramm 51959f09c7 Change types.pyi syntax that pytype can't parse. (#1157)
* Fix a few return types in stdlib/2/inspect.pyi.

* Rename _FrameRecord to _FrameInfo

* Correct some return types in itertools.pyi from Iterable to Iterator.

* Change types.pyi syntax that pytype can't parse.
2017-04-12 16:11:03 -07:00
rchen152andMatthias Kramm f34c550f04 Correct some return types in itertools.pyi from Iterable to Iterator. (#947)
* Fix a few return types in stdlib/2/inspect.pyi.

* Rename _FrameRecord to _FrameInfo

* Correct some return types in itertools.pyi from Iterable to Iterator.
2017-03-07 06:42:50 -08:00
rchen152andGuido van Rossum c9e992ea8d Fix a few return types in stdlib/2/inspect.pyi. (#916) 2017-02-06 08:19:14 -08:00
rchen152andMatthias Kramm b53e4c349d Fix HTMLParser.HTMLParser, HTMLParseError. (#565)
Signed-off-by: Rebecca Chen <rechen@rechen0.mtv.corp.google.com>
2016-09-21 11:55:02 -07:00