Commit Graph

22 Commits

Author SHA1 Message Date
Sebastian Rittau
25ac4d6af4 Implement StartResponse using a protocol (#2392)
* Add ExcInfo and OptExcInfo type aliases

* Implement StartResponse using a protocol

* Mark stub-only types with an underscore

* Remove wrong TODO note

python/mypy#1178 is about variable-length tuples, while exc_info()
always returns a tuple with length 3. Ideally, exc_info() would
return Union[Tuple[Type[_E], _E, TracebackType], Tuple[None, None, None]],
but that is a different issue.
2018-08-17 08:36:00 -07:00
Josh Holland
347595bafb Make argument to sys.settrace optional (#2309) 2018-07-04 10:15:30 -07:00
Yusuke Miyazaki
1ae2ba0fbe Use sys.platform instead of comments (#2286) 2018-07-03 08:13:04 -07:00
Sebastian Rittau
b05e99297c Drop Python 3.3 support from several stubs (#2266)
* Drop Python 3.3 support from importlib stubs

* Drop Python 3.3 support from html and symbol stubs
2018-06-20 16:46:11 -07:00
Andrew Svetlov
252d79981b Add a stub for sys.implementation (#2097) 2018-05-06 08:40:56 -07:00
Jelle Zijlstra
7cd2016931 add sys.base_exec_prefix and sys.base_prefix (#2047)
See https://docs.python.org/3/library/sys.html#sys.base_exec_prefix.

Required for https://github.com/python/mypy/pull/4888
2018-04-11 13:59:44 -07:00
Jelle Zijlstra
7cfbc7d17f more 3.7 features (#2015) 2018-04-06 11:09:11 -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
Carl Meyer
9e76d44b09 Fix sys.setprofile annotation. (#1679)
`sys.setprofile(None)` is valid, and is in fact the only way to clear a profiler once set.
2017-10-23 15:26:58 -04:00
Jelle Zijlstra
4ea6c1cffb sys: clean up (#1545)
- More precise types for trace and profile functions
- Remove redundant comments
2017-08-21 13:54:55 -07:00
Mike Patek
0e7b2e1acf Add 'sys.is_finalizing' function (#898)
Fixes #856
2017-01-30 10:25:39 -08:00
David Fisher
2cb8e184cc Add NoReturn (#811)
* Add NoReturn
2017-01-04 13:38:05 -08:00
Lukasz Langa
68a49c2c2e Fixing flake8 E111, E114, E116, E203, E225, E262 errors 2016-12-20 01:39:18 -08:00
Lukasz Langa
147772950f Fixing flake8 E265 errors 2016-12-20 00:16:44 -08:00
Lukasz Langa
fe0e3744cc Fixing flake8 E261 errors 2016-12-19 22:09:35 -08:00
Sebastian Meßmer
96ba62503b Use concrete type in sys.excepthook() (#547)
This is necessary, because exception formatting functions like `traceback.format_exception()` expect to get `Type[BaseException]`, but sys.excepthook only provided `type`
2016-09-14 08:03:41 -07:00
Valérian Rousset
4e55f0561f Improve traceback (#465) 2016-08-10 11:18:35 -07:00
Valérian Rousset
c40a260b47 fix sys.exc_info return type (#246) 2016-06-06 08:52:40 -07:00
Valérian Rousset
a32d8a9da6 add types to sys.getrefcount (#237) 2016-06-02 00:27:37 -07:00
Valérian Rousset
ff94f6def0 specifiy Callable in sys.call_tracing (#230) 2016-05-30 09:32:56 -07:00
Tim Abbott
a648f5eee1 Fix incorrect sys.exit() type. 2016-02-05 11:28:16 -08:00
Guido van Rossum
8c2118bace Move contents of builtins/* to stdlib/*. This simplifies finding stubs. 2016-01-12 12:53:18 -08:00