Commit Graph
415 Commits
Author SHA1 Message Date
Ilya KonstantinovandSebastian Rittau 1564770456 Add pynamodb.models.Model.get_attribute and narrow down the type (#2689) 2018-12-17 17:06:42 +01:00
Dominik GabiandSebastian Rittau dd2400df6a Fix property annotation in third_party/2and3/boto/connection.pyi (#2675) 2018-12-07 23:35:37 +01:00
Jukka LehtosaloandSebastian Rittau 184148611a Fix signature of TypedDict has_key() (#2672) 2018-12-05 18:17:37 +01:00
Michael LeeandSebastian Rittau 6f061bbf1e Add 'Literal[...]' to typing_extension stubs (#2664)
This pull request adds 'Literal' to the typing_extension stubs
and serves as the dual of this PR:
https://github.com/python/typing/pull/591

For background context, here's the associated PEP draft:
https://github.com/Michael0x2a/peps/pull/1
2018-12-05 00:46:23 +01:00
Jukka LehtosaloandGitHub c8890b0f93 Add mypy fallback class for TypedDict methods to mypy_extensions (#2670)
This class is not defined at runtime but it's used by
mypy internally to support TypedDict methods.

Use NoReturn in argument types for better type safety
when the related mypy plugin hook is not active.
2018-12-04 18:21:58 +00:00
jhanceandIvan Levkivskyi 1254b30f94 [protobuf] add deterministc option (#2666) 2018-12-03 21:53:31 +00:00
Pascal CorpetandSebastian Rittau b4b81fba24 Properly type the ToJsonString method of time well known types in google protobuf (#2656) 2018-11-30 13:42:58 +01:00
Utkarsh GuptaandSebastian Rittau 407e4bb679 decorators.pyi: Add Any angument to Callable[] (#2654)
Fixes #2615
2018-11-30 10:33:22 +01:00
jhanceandIvan Levkivskyi 5663dba895 [gflags] add known_only arg to __call__ (#2646) 2018-11-28 18:45:51 +00:00
Utkarsh GuptaandSebastian Rittau 03981de076 __init__.pyi: Fix dump() (#2640)
Fixes #2089
2018-11-28 09:08:30 +01:00
Florian BruhinandJelle Zijlstra 25c5f3cace yaml: Add __version__ attribute (#2636) 2018-11-27 20:56:01 -08:00
Keith GrayandSebastian Rittau 9c3978e337 Added cyaml.pyi (#2613)
Closes #1996
2018-11-24 18:13:14 +01:00
Matt GilsonandSebastian Rittau 8aa5feac57 Update types for requests.adapters (#2614) 2018-11-22 12:06:58 +01:00
Maarten ter HuurneandSebastian Rittau 89b06c833d Add stub for pytz.VERSION (#2619) 2018-11-21 22:04:00 +01:00
Sebastian RittauandGitHub 82c59a7fc2 Merge Python 2 and 3 versions of itsdangerous (#2564) 2018-11-20 17:55:16 +01:00
Sebastian RittauandJelle Zijlstra cd75801aa5 Replace non-ellipsis default arguments (#2550) 2018-11-20 07:35:06 -08:00
Matt GilsonandJelle Zijlstra b868c6c3c1 Relax type for click.echo. (#2607)
Fixes #2604
2018-11-18 19:25:11 -08:00
Pascal CorpetandSebastian Rittau c2ecb77ca5 Add options and extensions to google protobuf messages. (#2589) 2018-11-07 09:54:38 +01:00
Pascal CorpetandSebastian Rittau 23db1fc137 Strengthen typing of datetime methods of Google protobuf's Timestamp. (#2590) 2018-11-07 01:46:02 +01:00
Sebastian RittauandJelle Zijlstra e3a79d0ce6 Remove third_party/3/enum.py (#2563)
All Python 3 versions supported by typeshed (3.4+) have enum as part
of the standard library.

Make the third-party Python 2 version consistent with the Python 3 version.
2018-10-27 08:54:56 -07:00
Sebastian RittauandJelle Zijlstra 0730fe5fcb Fix return of patch() and patch.multiple() (#2520)
* Fix return of patch() and patch.multiple()

* Update third party mock as well
2018-10-25 20:55:11 -07:00
Sebastian RittauandJelle Zijlstra 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 RittauandJelle Zijlstra c4f4c40601 Annotate jwt.algorithms (#2532)
Cf. #1446
2018-10-23 09:32:14 -07:00
Sebastian RittauandJelle Zijlstra 6d6894e1ef Annotate werkzeug wrap_file() and FileWrapper (#2519)
* Add FileWrapper protocol to wsgiref.types

* Annotate werkzeug's wrap_file and FileWrapper

* Remove empty line at end of file

* Fix _Readable protocols
2018-10-23 13:43:53 +02:00
Michael LeeandSebastian Rittau 53d12c0a6c Makes enums accept objects in the argument type (#2539)
Fixes problems with using enums with the --disallow-any-expr flag.
2018-10-23 09:52:15 +02:00
MichaelandSebastian Rittau 82d54ce57b Update PyJWT's exceptions (#2522)
Regards jpadilla/pyjwt#316, jpadilla/pyjwt#335, jpadilla/pyjwt#340
2018-10-21 13:30:37 +02:00
Daniel LiandSebastian Rittau 254af0ff2a Add stub for pathlib2.Path.__div__ (#2507) 2018-10-16 07:31:58 +02:00
Grzegorz ŚliwińskiandSebastian Rittau 4ed42f899e click.option's defined type as return type of callable (#2505) 2018-10-16 03:53:29 +02:00
Benjamin PetersonandJelle Zijlstra b2a9f2e383 Add new gflags names. (#2489)
As a described in https://github.com/google/python-gflags/blob/master/absl_migration/migration_guidelines.md, gflags did a mass rename to PEP 8-style names.
2018-10-01 20:18:51 -07:00
Ruben BerenguelandJelle Zijlstra 3814d47aff Change json arguments in requests to Any (#2497)
Fixes #2492
2018-09-30 09:23:34 -07:00
Benjamin PetersonandJelle Zijlstra a8cfde79c4 Use structural inference for enum34 EnumMeta. (#2490)
Fixes python/mypy#5577.
2018-09-27 09:27:41 -07:00
Ran BenitaandJelle Zijlstra 4f396f8130 Improve the pytz stubs (#2475)
Based on the pytz docs http://pytz.sourceforge.net/ and code (version
2018.5).

- Accurately model the return value of the `timezone()` function. This
  necessitates modeling the internal pytz class hierarchy which is quite
  inconsistent.

- Expose `_BaseTzInfo` as `BaseTzInfo`.

  This change is useful because this type is importable and otherwise
  there is no pytz type which can be used in type annotations, e.g. in a
  function which takes a pytz `tzinfo` with the `localize` method,
  rather than a general `datetime.tzinfo`.

- Remove the lazy.pyi stubs. The `lazy` module contains some unrelated
  general data structures. It is not a public API - it is not documented
  and the types are not included in `__all__`.

- Remove methods which are already specified by inheritance in
  `datetime.tzinfo`.

- Add several public exception classes.

- Fill in the generic type parameters of the exposed `Dict`/`List`
  constants. Also change `Dict` -> `Mapping` because it is not actually
  a proper `dict`.

- Some style/ordering improvements.
2018-09-26 07:11:24 -07:00
Rebecca ChenandJelle Zijlstra cfa52c7c38 Add a stub for google.protobuf.json_format. (#2479) 2018-09-25 21:03:27 -07:00
Rebecca ChenandSebastian Rittau 77e4d5d5a8 Add six.moves.urllib_request and six.moves.urllib_response. (#2455) 2018-09-13 22:01:56 +02:00
Teddy SudolandSebastian Rittau b40cae139f Add more complete type hints for pkg_resources. (#2433)
The current file only covers pkg_resources/__init__.py.
pkg_resources/py31compat.pyi is used by setuptools, for example.
2018-09-13 22:00:04 +02:00
Jon DufresneandSebastian Rittau 47f22a341e Add def __getattr__(name) -> Any: ... to all docutils stubs (#2439)
The stubs are very incomplete causing false positive when used. Add a
fallback to until they can become more complete.
2018-09-13 21:59:13 +02:00
Ivan LevkivskyiandGitHub 75e13a0f36 Add Final to typing_extensions (#2453) 2018-09-13 15:07:42 +01:00
Sebastian RittauandJelle Zijlstra 27514df2bd Fix annotation of boto Key.set_contents_from_string (#2445)
Closes #1552
2018-09-11 08:25:25 -07:00
Sebastian KreftandJelle Zijlstra c96812425a Overload the definitions of dataclasses.asdict and dataclasses.astuple (#2422) 2018-09-06 22:14:28 -07:00
Michael J. SullivanandGitHub 55b9aaf916 Add Optional to typed_ast's arguments.type_comments (#2430)
This covers the case where some but not all arguments have a `# type:` comment.
2018-09-06 18:56:10 -07:00
Jelle ZijlstraandRebecca Chen 9d62d6d5c5 fix __metaclass_ references (#2402) 2018-09-06 18:24:03 -07:00
Ivan LevkivskyiandJelle Zijlstra 8ed0159445 Remove duplicate method definitions in importlib and jinja2 (#2427) 2018-09-04 07:50:47 -07:00
Jelle ZijlstraandGitHub 2e1c81684e fix duplicate definitions in tornado (#2424)
Fixes #2423.

I followed https://github.com/tornadoweb/tornado/blob/master/tornado/httpclient.py and kept the `@property` where it exists in the implementation and the attribute where it doesn't.
2018-09-03 16:39:51 -07:00
Teddy SudolandJelle Zijlstra c52c59f521 Remove duplicate adapters import. (#2414)
This causes an error in pytype.
2018-08-23 17:01:47 -07:00
Tomasz TrębskiandJelle Zijlstra 50a62b6a6a Improve werkzeug/exceptions typings (#2405) 2018-08-22 08:49:11 -07:00
Teddy SudolandJelle Zijlstra 2cd0aa16b5 Fix pkg_resources.pyi formatting (#2396) 2018-08-21 21:51:04 -07:00
Sebastian RittauandJelle Zijlstra a2676ec972 Improve werkzeug stubs (#2391) 2018-08-17 08:35:14 -07:00
Michael J. SullivanandJukka Lehtosalo d45fc3daaf Fix typed_ast's Num type (#2387) 2018-08-16 11:36:13 +01:00
Brandon LinandJelle Zijlstra 700efc43dd add missing stubs in cryptography rsa/serialization (#2376) 2018-08-15 20:50:56 -07:00
MinJune KimandJelle Zijlstra dc6d1ff8d3 Re-add .resolve() method to package_resources.Entrypoint (#2385)
Fixes #1463
2018-08-15 10:40:45 -07:00