Commit Graph

217 Commits

Author SHA1 Message Date
aubanel
666f71fb56 Add a few methods to Element and ElementTree (#1585) 2017-09-22 07:11:15 -07:00
Jonathan Schoonhoven
dc46a435da allow all valid JSON in pynamodb JSONAttribute (#1604)
Currently, the type definition for `JSONAttribute` assumes the deserialized value will be a `dict`. However, a `list` is also a valid `JSONAttribute` (its [deserialize](495eae2867/pynamodb/attributes.py (L418)) method just calls `json.loads`.
2017-09-22 06:57:51 -07:00
Alex Grönholm
023afbc098 Fixed the signature of six.raise_from() (#1563)
* Made the from_value argument optional in raise_from()

* Fixed six.raise_from() from_value and return type for both py2 and py3
2017-08-26 14:43:43 -07:00
Tim Crawford
341237339c requests: Add return type for __init__ methods (#1574) 2017-08-25 20:34:56 -07:00
Ivan Levkivskyi
42e2142f28 Add Protocol and runtime to typing_extensions (#1564)
* Add Protocol and runtime to typing_extensions

* Use private type variable

* Fix typo

* Bound type variable for runtime to only class objects

* Conform to version check specification
2017-08-21 13:22:48 -07:00
Ashwini Chaudhary
46a73bb2e8 Added private method _basic_auth_str to stub for requests (#1514) 2017-08-11 17:11:28 -07:00
Zack Hsi
6031b37be9 Add select_autoescape to jinja2 (#1530)
Fixes https://github.com/python/mypy/issues/3589.
2017-08-07 17:19:45 -06:00
Pavel Pletenev
b2df503cde Add type annotations for emoji (#1506)
This adds type annotations for [`emoji` library](https://github.com/carpedm20/emoji/)
2017-08-03 16:12:50 -07:00
Svyatoslav Ilinskiy
7a580ed0a9 Re-export values for click library (#1516)
That way they can be used as
```
import click
click.<value>
```
2017-08-03 15:58:02 -07:00
Svyatoslav Ilinskiy
98d768b2c6 Re-export simplejson values (#1517) 2017-08-03 08:33:51 -07:00
Michael Lee
1e04a8c1b8 Add stubs for typing_extensions module (#1471) 2017-07-23 12:19:49 -07:00
Jelle Zijlstra
1515ed9f88 fix some abstract classes in third_party/ (#1486) 2017-07-19 20:27:22 +03: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
Jelle Zijlstra
16aa0651ae Revert "Add __new__ to str and int stubs in both Pythons. (#1352)" (#1466)
This reverts commit fed4e03e53.
2017-07-06 14:21:54 -07:00
Roy Williams
7720a90bde Add stubs for pynamodb (#1431)
Approval here: https://github.com/pynamodb/PynamoDB/issues/209
2017-07-03 14:11:22 -07:00
Teemu R
218ce96871 PyYaml: uncomment commented out imports and add missing classmethod decorators (#1439)
* uncomment yaml imports

* yaml: decorate classmethods
2017-06-30 22:22:55 -07:00
Peter Vilim
bc9b2f0d4d Fix signature for slite3.fetchmany (#1444)
Also made pymssql.fetchmany simpler.
2017-06-29 15:05:47 -07:00
Jukka Lehtosalo
9b612c9218 Add TypedDict total argument (#1443)
See https://github.com/python/mypy/pull/3558 for context.
2017-06-29 08:38:13 -07:00
Max Rozentsveyg
d3f9c55203 Add type stub for requests.packages.urllib3.util.connection.HAS_IPV6 (#1436)
This is defined at https://github.com/requests/requests/blob/v2.14.2/requests/packages/urllib3/util/connection.py#L130
2017-06-26 11:52:24 -07:00
Svyatoslav Ilinskiy
ee5e3affe1 Update Num stub for typed_ast 2.7 (#1430)
Field `n` should be a `Union[int, float, complex]`, not just `Union[int, float]`
2017-06-23 16:43:23 -07:00
Guido van Rossum
9238c737de Make HasField and ClearField use Text instead of str (#1425)
This allows one to write `x.HasField("ok")` even if the file has
`from __future__ import unicode_literals`"
2017-06-21 10:51:49 -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
Guido van Rossum
81f77b17ec Remove double Optional[] (#1423) 2017-06-21 09:54:40 -07:00
Guido van Rossum
04fe184dcf Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy (#1421)
* 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
2017-06-20 22:18:49 -07:00
Atul Varma
b8b3146904 Add PyJWT type annotations (#1281) 2017-06-20 13:19:09 -07:00
Svyatoslav Ilinskiy
d5eb32d67e Support iteration over enums with enum34 (#1412)
* Support iteration over enums in python 2

* fix lint
2017-06-19 06:39:56 -07:00
Semyon Proshev
fed4e03e53 Add __new__ to str and int stubs in both Pythons. (#1352)
* Update default values to `...` in `__init__` and `__new__` in `int` and `str`.
* Add `__new__` to `enum.IntEnum` to override inherited `__new__`.
* Add `type: ignore` comment to `IntEnum`
2017-06-12 20:53:32 -07:00
Thomas Grainger
55f1883928 requests.(post|put|patch) json kwarg should be Any. (#1387)
```python
>>> requests.post('https://httpbin.org/post', json=["ham", "spam", {"eggs": "bacon"}]).json()
{'args': {}, 'data': '["ham", "spam", {"eggs": "bacon"}]', 'files': {}, 'form': {}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'close', 'Content-Length': '34', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.17.3'}, 'json': ['ham', 'spam', {'eggs': 'bacon'}], 'origin': '82.70.100.78', 'url': 'https://httpbin.org/post'}
>>> requests.post('https://httpbin.org/post', json=("ham", "spam", {"eggs": "bacon"})).json()
{'args': {}, 'data': '["ham", "spam", {"eggs": "bacon"}]', 'files': {}, 'form': {}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'close', 'Content-Length': '34', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.17.3'}, 'json': ['ham', 'spam', {'eggs': 'bacon'}], 'origin': '82.70.100.78', 'url': 'https://httpbin.org/post'}
```
2017-06-08 11:53:26 -07:00
Alex Khomchenko
25b3a818d3 add required to click.option decorator (#1397) 2017-06-08 11:52:25 -07:00
Michael Lee
d25c5b9ce4 Move stubs for 'click' into 2and3 folder (#1364) 2017-06-02 11:01:24 -07:00
Yusuke Miyazaki
2b79108ddc Fix stub for ujson (#1374) 2017-05-30 23:20:40 -07:00
Jelle Zijlstra
4f2dd0f446 remove unused type ignore flags (#1346)
Verified that none of those are necessary for pytype.
2017-05-26 08:28:51 -07:00
Cooper Lees
70363c27a7 Fix missed callback arguments to Click Decorators (#1327) 2017-05-23 21:22:25 -07:00
Cooper Lees
df657161f0 Tweak Click 6.6 Decorator Type Stubs (#1244)
* Tweak Click 6.6 Decorator Type Stubs
- Add context_settings for command
- Make callback Callable type accept some more types

To address Issue 1238

* Update decorators.pyi
2017-05-23 14:01:49 -07:00
Emily Morehouse
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
Max
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
Jelle Zijlstra
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
li-dan
e080d8ea77 Add missing methods to Python 2 concurrent.futures (#1236)
* Add missing methods to Python 2 concurrent.futures

Future.exception_info() and Future.set_exception_info() are methods
present only in the Python 2 backport of concurrent.futures.

* Mark timeout args as optional
2017-05-04 08:24:50 -07:00
Naomi Seyfer
c96a64d421 Remove second empty line in mypy_extensions (#1237) 2017-05-02 21:41:23 +01:00
Naomi Seyfer
6a9d74d1c7 Args for "flexible callable" experimental mypy feature. (#793)
This is the typeshed for the constructors for the Arg types that we'll now be
able to pass to Callable.  They really just return their type arguments.
2017-05-02 21:40:41 +01:00
Jelle Zijlstra
b9e896d97c make type aliases in lxml.etree private (#1216)
Naming the alias "AnyStr" isn't a great idea since AnyStr normally means
the typevar.

Also removed some whitespace in accordance with typeshed style.
2017-04-30 09:36:37 -07:00
Jelle Zijlstra
1350d7e4d2 Fixes for datetime and relativedelta (#1191)
Fixes #1163.
2017-04-22 15:52:55 -07:00
David Euresti
759da86478 Cleanup six.moves module (#1180)
* Cleanup six.moves

Regenerate files so all imports are present, comment out imports that fail.
Remove useless files.

* Fix flake8
2017-04-21 16:03:19 -07:00
Łukasz Langa
f543ddd89a Move yaml stubs to 2and3 (#1155) 2017-04-12 21:09:23 -07:00
Guido van Rossum
3594b0e607 Fix JSONWebSignatureSerializer.load_dangerous() signature to satisfy mypy. (#1135)
The latest mypy complained that the signature didn't match that in the
superclass: Serializer.load_payload() has a serializer argument.  I
don't know this project but I think it's best to just add that
argument (rather than adding `# type: ignore`).
2017-04-04 09:51:56 -07:00
Ashwini Chaudhary
35b6795183 Stubs for boto.kms (#1081)
* Stubs for boto.kms

* Added types for params

* Added return type and fixed signatures(including review changes)

* Removed make_request from stub(https://github.com/python/mypy/issues/1237). Fixed Dict issue.

* Fixed typo

* Let's be precise about return type
2017-04-03 21:22:32 -07:00
Bertrand Bonnefoy-Claudet
138073922d Allow user-defined kwargs passed to click.group (#1092)
Fixes #1086
2017-03-29 10:20:41 -07:00
Guido van Rossum
03bfcee0b8 Remove sqlalchemy. (#1105)
See discussion in https://github.com/python/typeshed/pull/1094.

If we do this we should make it easier in mypy to install 3rd party stubs that are used by default.
2017-03-28 08:25:00 -07:00
Thomas Ballinger
13bcc79c12 correct return value of Future.set_running_or_notify_cancel (#1078) 2017-03-22 16:59:07 -07:00
Jelle Zijlstra
8318953a17 remove if TYPE_CHECKING in sqlalchemy stub (#1074)
This isn't needed in typeshed, since the stubs aren't executed.
2017-03-22 08:02:38 -07:00