Commit Graph
1545 Commits
Author SHA1 Message Date
Jelle ZijlstraandMatthias Kramm 890190d349 add opcodes to pickle stubs (#1321) 2017-05-24 08:05:55 -07:00
Jelle ZijlstraandMatthias Kramm 97f32a57a2 complete __future__ stubs (#1326)
We were missing the most important one.
2017-05-24 08:02:47 -07:00
Jelle ZijlstraandMatthias Kramm 5e4165493a fix typo in importlib.abc (#1323) 2017-05-24 08:00:12 -07:00
Jelle ZijlstraandMatthias Kramm c930e889ee merge 2 and 3 stubs for fileinput (#1319)
* merge 2 and 3 stubs for fileinput

Plus some minor fixes.

* pytype doesn't like generic type aliases
2017-05-24 07:58:56 -07:00
Sebastian MeßmerandJelle Zijlstra 3cfc146223 Fix type stubs in streams.pyi (#1252) 2017-05-23 23:14:41 -07:00
Jelle ZijlstraandMatthias Kramm 4ea798b869 inspect.getmoduleinfo was removed in 3.6 (#1318)
Compare https://docs.python.org/3.5/library/inspect.html#inspect.getmoduleinfo
and https://docs.python.org/3.6/library/inspect.html
2017-05-23 16:52:16 -07:00
Jelle ZijlstraandMatthias Kramm cca81d864a complete doctest stub (#1315)
* complete doctest stub

And merge it into 2and3 (the old stubs were virtually empty).

* note things changed in 3.4

2.7 also had an undocumented and deprecated doctest.Tester class. I'm going to leave it out until somebody asks for it to be added.
2017-05-23 16:34:34 -07:00
Luka SterbicandMatthias Kramm 9601a76b54 Use AsyncResult from multiprocessing.pool (#1317) 2017-05-23 16:33:46 -07:00
Jelle ZijlstraandMatthias Kramm 6c5474ae8c various fixes to asyncio stubs (#1305) 2017-05-23 16:14:29 -07:00
Jelle ZijlstraandMatthias Kramm 0bda8c0cef fixes and additions to the configparser stub (#1311)
* fixes and additions to the configparser stub

This broke pytype because of the type ignore. I think it's OK to blacklist
because another instance of this same error (stdlib/3/email/policy.pyi line 95)
is already blacklisted. We can remove it when the pytype parser is fixed to
allow type ignores in this context.

* add SectionProxy.__getattr__

* the __getattr__ returns Any

* don't need type ignore for pytype if we put it all on one line
2017-05-23 15:36:42 -07:00
Jelle ZijlstraandMatthias Kramm 42cd0f59e5 add functools.partialmethod (#1316)
Plus other cleanup to the py3 functools stub
2017-05-23 15:36:09 -07:00
Jelle ZijlstraandMatthias Kramm 9ae9a9e741 merge Python 2 and 3 stubs for difflib (#1313)
These were already virtually identical.

I didn't review the stubs themselves for correctness. I'll make some changes after this
PR is in.
2017-05-23 15:01:30 -07:00
Jelle ZijlstraandMatthias Kramm 05a4059b3b make TimeTuple private in datetime.pyi (#1312)
Also, these stubs aren't incomplete.
2017-05-23 15:01:02 -07:00
Luka SterbicandMatthias Kramm 9b2b60eafc Make Lock usable as contect manager (#1314) 2017-05-23 15:00:32 -07:00
Jelle ZijlstraandMatthias Kramm 1dda4ac105 merge python 2 and 3 stubs for calendar (#1310)
These are pretty much the same in the stdlib, except that TimeEncoding
got renamed to different_locale.
2017-05-23 12:47:24 -07:00
Jelle ZijlstraandMatthias Kramm 3267e2396b Dummy thread improvements (#1309)
* dummy_thread improvements

- Complete the Python 3 stub
- Add a Python 2 stub. They're close enough that they should go into 2and3, but
  the module name changed so we can't do that.

* fix my bugs
2017-05-23 12:46:42 -07:00
Jelle ZijlstraandMatthias Kramm 48796411ed curses: make names private that don't exist at runtime (#1308)
And add some missing return types
2017-05-23 12:46:05 -07:00
Jelle ZijlstraandMatthias Kramm 14f7492fe0 os.walk allows PathLike (#1306) 2017-05-23 12:45:40 -07:00
Jelle ZijlstraandMatthias Kramm 6f6fa428ce fix some issues found by stubcheck (#1303)
- ThreadError exists (undocumented) on Python 3. It's an alias for _thread.error,
  but making it a separate exception seems fine.
- zipfile.error is an alias for BadZipFile on both Python versions.
- zlib.Compress and Decompress are not actually accessible at runtime.
2017-05-23 12:44:35 -07:00
Jelle ZijlstraandMatthias Kramm 0aa7138c4e fixes to logging stubs (#1302)
Found with my stubcheck tool
2017-05-23 12:43:49 -07:00
Jelle ZijlstraandMatthias Kramm 915a91f80d fix "isisgeneratorfunction" (#1301) 2017-05-23 09:51:54 -07:00
Jelle ZijlstraandMatthias Kramm 764d949f04 make _ast.identifier private (#1307)
It doesn't exist at runtime.
2017-05-23 09:51:29 -07:00
Benjamin StarlingandJelle Zijlstra 9abbc0d392 Fix unittest.mock.Mock keyword arguments to address #1282 (#1300) 2017-05-22 23:30:40 -07:00
Jelle ZijlstraandGuido van Rossum d571f101ba fixes to selectors stub (#1304)
Make type aliases private; add defaults
2017-05-22 23:12:02 -07:00
Emily MorehouseandGuido van Rossum 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
amstreeandJelle Zijlstra 028f2dd0a4 add captureWarnings to stdlib logging (#1298)
Fixes #1235
2017-05-22 15:57:40 -07:00
Daniel LiandJelle Zijlstra 787e423468 Annotate textwrap.dedent (#1295) 2017-05-22 15:53:04 -07:00
Emily MorehouseandGuido van Rossum adae702fc1 Moves pdb stub to 2and3 (#1294)
- Moves the pdb stub from separate `2`/`3` files to a single file in `2and3`, as they were identical.
- Maintains the comment header, as the stub is incomplete.
2017-05-22 15:48:14 -07:00
John ReeseandJelle Zijlstra 54408054cc Add type stubs for multiprocessing.Manager() (#1270)
* Use Dict/List types and _Namespace alias

* Use TypeVar definitions for mapping/sequence stubs
2017-05-22 15:31:23 -07:00
Emily MorehouseandGuido van Rossum 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
Jason FriedandJelle Zijlstra a2aa93ac29 subprocess.py env and cmd arguments accept None (#1291) 2017-05-22 15:06:24 -07:00
James ElfordandJelle Zijlstra 2d4cd76765 Add new hashes introduced in Python 3.6 (#1268)
* sha3 family of hash functions
* shake variable length hashes that were introduced alongside sha3
* blake2 family of hash functions
* Mark VarLenHash as a private class, since it's not actually exported by hashlib
* Fix typos in my last, and mark hashlib.Hash as a private class since it isn't in the real hashlib
2017-05-22 07:57:31 -07:00
Jelle ZijlstraandGuido van Rossum 728b977729 Replace a number of default argument values with "..." (#1280)
pytype apparently doesn't like default values that aren't ints or
None/True/False.
2017-05-21 14:31:22 -07:00
Mahmoud AfanehandJelle Zijlstra 3896298027 Add multiprocessing.context stubs (#1260) 2017-05-20 23:13:18 -07:00
Matthias KrammandJelle Zijlstra 8d8708594e Make sys.modules a Dict[str, Any] (#1266)
* Add __getattr__ to ModuleType.

Modules can contain anything, so give them a generic "__getattr__(name) -> Any".
This makes code like the following type-check, in pytype:
    sys.modules.get("random").randint

* undo Python 3 change

* Revert "undo Python 3 change"

This reverts commit 96cf2d529e374a754f1ba681f0fc81aab25f81ef.

* Revert "Add __getattr__ to ModuleType."

This reverts commit 3ac1cf8a3b25dabfe386fbf34aef680fb1acd112.

* In stdlib/2/, make sys.modules a Dict[str, Any].

(Instead of Dict[str, ModuleType])
Same as stdlib/3/.
2017-05-20 11:08:25 -07:00
Jan HermannandJelle Zijlstra d68d0c5c00 fix asyncio.BaseEventLoop.create_task for >=3.5 (#1272)
* fix python/typeshed#1202 asyncio.BaseEventLoop.create_task for >=3.5

* remove unnecessary version distinction
2017-05-20 11:06:10 -07:00
Yusuke MiyazakiandMatthias Kramm c19e266dcf Fix StringIO stub for Python 3 (#1275) 2017-05-19 17:02:57 -07:00
Ryan JarvisandMatthias Kramm 4ab29832a2 Extend typing to CursesWindow object (#1271)
* Extend typing to CursesWindow object

* Correct delch() signature
2017-05-17 16:07:08 -07:00
George CaleyandMatthias Kramm eac0562088 Fix return types in compileall.pyi (#1273)
* add non-None return types for compileall

* fx -> rx
2017-05-17 16:05:50 -07:00
MaxandJelle Zijlstra df9df65882 More precise signatures in concurrent.futures (#1262)
* Allow None in concurrent.futures.exception() and set_exception()

* Make Executor.map() signature more precise

* Remove superfluous signatures

* Specify str type for some concurrent.futures constants

* Update concurrent.futures backport

* CR fixes
2017-05-14 13:55:27 -07:00
Sergey PassichenkoandJelle Zijlstra 6207eb8cde Add args attribute to subprocess.Popen (#1267) 2017-05-14 13:41:38 -07:00
MaxandGuido van Rossum c2e6a6f670 Add queue.Queue.empty() stub (#1259)
Fixes #1242. Seems like one method was omitted by accident.
2017-05-10 18:39:56 -07:00
Mahmoud AfanehandJelle Zijlstra 30283aa670 Adds Event stub to multiprocessing (#1247)
* Adds Event type to multiprocessing

* Add event and context stub to multiprocessing stub.  Updates per recommendations.

* Adding missing newline at EOF.

* Stubbing just BaseContext and not any of the member functions.

* Fix flake8 extra line.

* Fix comment.

* Add todo for BaseContext, make ctx of Any type, and remove multiprocessing.context
2017-05-10 07:20:19 -07:00
Jelle ZijlstraandMatthias Kramm 8d1114c0c3 allow string levels in logging (#1234)
* allow string levels in logging

* remove redundant Union member
2017-05-10 07:09:08 -07:00
Matthias KrammandJelle Zijlstra 8d8a34cb83 Patch from @sfreilich: make itertools.ifilter predicate parameter Optional (#1257)
From Samuel Freilich:
In Python 2, the predicate parameter in itertools.ifilter and
itertools.ifilterfalse can be None, indicating that true or false values
should be retained (functionally equivalent to passing "bool" as the
predicate). In Python 3, filter and itertools.filterfalse have
the same behavior.
2017-05-09 17:50:11 -07:00
Yusuke MiyazakiandMatthias Kramm d7dd9fb832 Update stub for ipaddress (#1251) 2017-05-08 16:28:04 -07:00
Sebastian MeßmerandMatthias Kramm 2ed9ee104f Fix type stubs in transports.pyi (#1255) 2017-05-08 16:26:01 -07:00
Sebastian MeßmerandMatthias Kramm 595e601882 Fix type stubs in events.pyi (#1256) 2017-05-08 16:24:25 -07:00
Sebastian MeßmerandMatthias Kramm 9311e980f4 Fix type stubs in subprocess.pyi (#1253) 2017-05-08 16:24:02 -07:00
Jelle ZijlstraandMatthias Kramm 7dd2f80194 Fixes to ContextManager (#1249)
* add typing.ContextManager for 3.6+ only

This fixes the easier part of #655.

Would it make sense to add a generic typing.ContextManager that exists in any Python version?

* update comment

* fix argument types for ContextManager.__exit__

* add AsyncContextManager

* add @asynccontextmanager

* typing.ContextManager now always exists

* back out async-related changes

Will submit those in a separate PR later

* fix import order

* AbstractContextManager only exists in 3.6+

* AbstractContextManager -> ContextManager
2017-05-08 16:21:51 -07:00