* Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy
* Make implicit Optional explicit in arg types (2and3 part)
* Convert {stdlib,third_party}/2 to explicit Optional
* DictReader should not be abstract. Reformat long lines.
* Make restval optional for DictWriter.__init__.
* The arg to reader() is *Iterable*, not *Iterator*.
* Improve signature of float() (use Union instead of overload).
Update stub for spwd
- Use `NamedTuple`
- Fix stub for Python 3
- Some attributes are changed from Python 2
- `sp_nam` -> `sp_namp`
- `sp_pwd` -> `sp_pwdp`
- add include_package_data (which setuptools accepts)
- allow arbitrary other kwargs, because distutils.core.setup allows arbitrary kwargs and just passes them through to commands
* 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.
- 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.
- 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
- 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 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
The previous change was still right. Unique among `poplib` functions, `uidl()` returns a long response when called without arguments, but just a bytes string when called with a `which` argument.
* 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