Commit Graph

21 Commits

Author SHA1 Message Date
Sebastian Rittau fe69ffcb0f Add a few missing stdlib modules (#4550) 2020-09-18 11:28:25 -04:00
Eric Traut baaffed1ac Added missing type annotations in various stdlib stubs. (#4402)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-06 18:27:21 -07:00
Jelle Zijlstra 0142a87da8 adjust isort config (#4290)
Fixes #4288.

- Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally.
- Treat typing_extensions, _typeshed and some others as standard library modules.

Note that isort master is very different from the latest release; we'll have to do something
different if and when the next isort release comes out.
2020-06-29 00:00:21 -07:00
Jelle Zijlstra 5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Sebastian Rittau 51cf2f51b8 Add IO protocols to _typeshed (#4230) 2020-06-14 20:44:48 +02:00
Shantanu 003fc6fa31 json: mark keyword-only args, remove deprecated arg (#3756)
* json: mark keyword-only args

Technically only true for Python 3.6+, but I didn't feel like copying
over the whole file just for Python 3.5. Let me know and I can.

* json: remove encoding from loads

This has been ignored and deprecated since 3.1 and will be removed in 3.9
It no longer even shows up in inspect.signature (in 3.8 it emits the
deprecation warning based on kwargs)

* json: update whitelists
2020-02-21 21:21:32 -08:00
Shantanu 46d9b38fa1 json: mark kwonly args, improve decode (#3679)
* json: mark args as kwonly for py36 on
* json: add undocumented arg to JSONDecoder.decode
2020-01-29 11:20:08 +01:00
Sebastian Rittau 256b3ce8ab Remove a bunch of unused imports (#3323) 2019-10-08 07:59:32 -07:00
Sebastian Rittau c32e1e2280 Enable --disallow-any-generics for stubs (#3288) 2019-10-01 05:31:34 -07:00
Sebastian Rittau 9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Ville Skyttä 8e0d288ea4 json: require a JSONDecoder/JSONEncoder in cls (#3138) 2019-07-23 22:59:57 +02:00
Michael Lee efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Sebastian Rittau 006a79220f Flake8 fixes (#2549)
* Fix over-indented continuation lines

* Fix under-indented continuation lines

* Fix whitespace around default operator problems

* Limit line lengths

* Fix inconsistent files
2018-10-24 07:20:53 -07:00
Sebastian Rittau 7ad682b0ae Improve annotations for json.load() and loads() (#2382)
* loads() only accepts str as first argument for Python < 3.6
* Use a protocol for the first argument to load() (cf python/typing#564)
2018-08-14 10:41:33 -07:00
Anthony Sottile 2d4bb04ab3 json.load can also take IO[bytes] in py36+ (#2188) 2018-06-03 19:02:55 -07:00
Jelle Zijlstra 324f1761f4 Change more defaults to ... (#1727) 2017-11-09 10:32:17 -08:00
Jelle Zijlstra 54dd6ba27c Change numerous default values to ... (#1722)
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Martin DeMello d389ef3d85 Remove a few files from the pytype blacklist. (#1628)
Fixes the following issues:

* Literals rather than ... for default values
* None rather than ... for default value of typed variable
* Literals rather than ... # type for top level constants
* # Foo rather than # type: Foo
* return value of init not set to None
2017-09-27 07:57:13 -07:00
Ivan Levkivskyi d75ea88da5 Use 'as name' patter to re-export names from stubs (PEP 484) (#1484) 2017-07-14 21:31:53 -07:00
Guido van Rossum 350563223f Add Optional[] for all remaining cases of x: <type> = None (#1424)
* Final round of adding Optional[] to type of arguments with default = None
* Update Travis to use --no-implicit-optionals and clarify CONTRIBUTING.md
2017-06-21 10:50:21 -07:00
Jelle Zijlstra 397f998368 Make json into a package to match the implementation (#1194)
This is the other half of fixing #1115.

Also fixed the stub for JSONDecodeError and made it only exist in 3.5+.

Didn't otherwise review the exact attributes and types in the package.
2017-04-24 15:32:05 -07:00