* 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.
* 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
- 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.
- 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.
* 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/.
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.
* 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
* Fix incorrect usage of AnyStr
- sqlite3 was using Union[bytes, AnyStr], which doesn't make sense
- The urllib functions I changed accept either bytes or str for their "safe"
argument
- Also added supports for PathLike to pstats
- Remove some unused imports of AnyStr
* pstats: python 2 accepts unicode
* Add pyi for pydoc [Python 2.7]
* Fixed issues
* A few more fixes
- `synopsis -> Optional[AnyStr]`
- `visiblename` takes a `Container`
- `getdoc -> Union...` not `AnyStr`
* `synopsis` and `source_synopsis`
CPython _warnings module implementation accepts Warning subclasses and None, but not any subclass of BaseException
specified in the stub. The stub for warnings is correct.
* 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.
* Simplify and add missing types for copy module.
Error and error were missing. I also removed the internal arg memo.
* Move copy module into 2and3
* Bring back internal kwargs