Commit Graph

2688 Commits

Author SHA1 Message Date
Jelle Zijlstra
ada0570efc Revert "Define functools.partial as overloaded function instead of its own class (#2878)" (#3077)
This reverts commit e45f443d85.
2019-06-20 20:39:49 -07:00
crusaderky
9941616b9e Add mp_context parameter to concurrent.futures.ProcessPoolExecutor (#3078)
Closes #3076
2019-06-20 19:42:26 +02:00
秋葉
2b6a99c39c fix ssl.Purpose type in py3 (#3054) 2019-06-20 19:41:32 +02:00
Rune Tynan
58221cf20e Add types and functions in types.py that are new in 3.7 (#3066)
* Add types and functions in types.py that are new in 3.7

* Update `resolve_bases` to accept any iterable of objects, and the same
for `new_class` if the version is at least 3.7

* Add comparison overrides implemented by MethodWrapperType

* Fix mypy error due to over-constrained `__eq__`
2019-06-19 15:20:57 -07:00
Eric Arellano
1763f51c0d Refactor tests/pytype_test.py (#3065) 2019-06-19 15:19:10 -07:00
Florian Ludwig
2e10326b50 change http.cookies.Morsel to Dict[str, Any] (#3060)
Morsel does cast any value to string and therfor any is the correct
typehint. For some keys other types then strings are more
appropiate anyway, max-age can take an integer (unix time) and http-only
a boolean.

Closes #3059
2019-06-19 15:17:16 -07:00
Matthew Wilkes
d149fe435c Represent the use of IntEnums in functions in socket.py. (#3009)
The Pull Request #1121 added the `AddressFamily` type to `socket.pyi`
for Python 3.4+, so constants such as `AF_INET` are correctly
represented as being an enum member rather than an int. The same is
true of the `SocketKind` enums in the `SOCK_*` family.

Various functions in the socket module can accept either an int
or an `AF_*` enum member as arguments, which is allowed by the
int argument type. However the `getaddrinfo` function returns an
`AddressFamily` member rather than an int in the first position
of its list members, so code that access enum specific members
such as the `name` attribute causes a typing error to be found.

This change corrects the return type of `getaddrinfo` but leaves
the family parameters as int, given that `AddressFamily` members
are `IntEnum` and only ever treated as `int`s internally.
2019-06-19 15:14:15 -07:00
Motoki Naruse
aa56af7dce HTMLParser.get_starttag_text() can return None (#3072) 2019-06-19 15:34:37 +02:00
Mathieu Bridon
38f253ed69 redis: Add some type hints (#3055) 2019-06-18 18:19:51 +02:00
Ivan Levkivskyi
01c2fa5a14 Sync recent typing and typing_extensions updates (#3070)
This includes two things to sync up with recent runtime updates:
* Move `Final`, `@final`, `Literal`, and `TypedDict` to `typing` (`typing_extensions` still defines or re-exports them)
* Rename `@typing.runtime` to `@typing.runtime_checkable`, while keeping `@runtime` as a backwards-compatible alias in `typing_extensions`.
2019-06-18 02:31:54 +01:00
Carl Meyer
fcb97fe8f1 Overload ast.parse to recognize that mode=exec means Module return. (#3039) 2019-06-17 23:27:14 +02:00
Jadiker
5447ff6bfe str and unicode format functions take objects (#3068) 2019-06-17 20:09:11 +02:00
Alexander Fasching
6258e7ddfd ssl.pyi: fix types of cadata argument (#3063) 2019-06-16 14:11:10 -07:00
Sean Vig
1efebf78e4 Marshal dumps/loads uses bytes (#3061)
The marshal.dumps and marshal.loads functions should return and accept
bytes, respectively, rather than a string.
2019-06-16 16:17:26 +02:00
Eric Arellano
d36a519b95 Update select and selectors to use _HasFileno protocol (#3057) 2019-06-15 16:35:18 -07:00
Mark Mendoza
1f740a7926 Adding stubs for pyre_extensions (#3056) 2019-06-13 23:14:54 +02:00
Joe Juzl
8ffe20fc22 Add redis stream methods to the client stubs (#3051) 2019-06-13 09:24:39 -07:00
Utkarsh Gupta
8e7c32846f request.pyi: Change Union[] -> Any for attributing status. (#3045)
Fixes #3026
2019-06-13 12:01:13 +02:00
John Freeman
e4a9cd580c Add missing path-like annotation (#3053)
Fixes #3052
2019-06-12 20:03:14 +02:00
Sebastian Rittau
b9101e9c5e Add a few Redis types (#3016)
* StrictRedis is an alias for Redis in current redis

* Add a few types

* Add missing import

* Add missing argument and types
2019-06-12 09:18:48 -07:00
Ivan Levkivskyi
5327484176 Use type annotation syntax (#3048) 2019-06-10 20:20:59 -07:00
Walter Scott Johnson
901cb33a3c Mark asyncio loop parameters as Optional (#3047) 2019-06-10 20:58:31 +02:00
Anthony Sottile
ed2a851ed8 dateutil: byweekday can take weekday (#3046) 2019-06-10 11:21:50 -07:00
Connor Skees
55a566340a Add copy() method to requests.Session.headers (#3043)
* Add `copy()` method to requests.Session.headers

* Use one type annotation
2019-06-08 12:19:57 -07:00
Rebecca Chen
d64a26cf99 Add missing constructor to types.CodeType. (#3040)
I got the argument order from
2bfc2dc214/Objects/codeobject.c (L263)
and the types from the attributes already in the stub.
2019-06-08 07:07:29 -07:00
Rebecca Chen
e7184d6dfc Add undocumented but used method LWPCookieJar.as_lwp_str. (#3041)
The method is defined here:
e36ed475ea/Lib/http/cookiejar.py (L1864)
2019-06-08 07:06:14 -07:00
Ivan Levkivskyi
61eb99664b Add new semantic analyzer to mypy tests (#3037)
This also removes two redundant definitions in curses/__init__.pyi star-imported from _curses.
2019-06-07 16:49:57 +01:00
nabnut
87f96dc1f0 Add stub for queue.SimpleQueue in 3.7 (#2995)
Closes: #2994
2019-06-07 11:50:39 +02:00
markedwards
5c94b58752 Add FullLoader and FullConstructor classes to yaml (#3035) 2019-06-06 17:47:39 +02:00
Evan Moses
db5fc492aa Added tojson_filter and detect_encoding to flask.json (#3030) 2019-06-05 23:39:49 +02:00
J Rob Gant
40c4e4ff3d Annotate HTMLParser attribute optional value (#3034)
Closes #3031
2019-06-05 18:51:52 +02:00
Sebastian Rittau
0e5b3770f8 Add a "pull requests welcome" batch (#3033)
We get quite a few bug reports where after a maintainer writes
"Pull Requests Welcome" we get a PR by the submitter. Maybe this
badge will help a bit to encourage people directly submit PRs,
reducing maintainer workload.
2019-06-05 07:51:01 -07:00
Benjamin Peterson
d6e2b02f72 Use custom tuple subclass for pwd.struct_passwd (#3017) 2019-06-05 11:59:32 +02:00
Radu Matei Lăcraru
a7785151aa Make AsyncGeneratorType.aclose() properly return Awaitable[None] (#3032) 2019-06-05 11:20:23 +02:00
Chandan Singh
233f2abf19 click: Use property decorator for read-only properties (#3028)
Since these properties do not have a setter, be explicit with the
`@property` decorator. This will allow type checkers to see that
assignment of these attributes is an error.

See https://github.com/python/typeshed/pull/3027#discussion_r289623016
for some related context.
2019-06-03 08:13:52 -07:00
Chandan Singh
018ecb3f16 Update Click to 7.0 (#3027)
Closes #3020.
2019-06-03 07:38:27 -07:00
Rebecca Chen
f8093d63cd Move stdlib/3/curses to stdlib/2and3/curses. (#3025)
Also add the A_ITALIC constant, which is new in 3.7.
2019-06-01 10:51:07 +02:00
秋葉
dd244d1200 fix Sniffer.sniff return type (#3023) 2019-05-31 07:22:36 -07:00
Mathieu Bridon
6061ca404e Move Redis stubs to 2and3 (#3015)
They actually work for both Python 2 and 3, mostly because they aren't
really typed yet.
2019-05-29 15:45:46 +02:00
Mark Mendoza
d8e14d6ead [pyre] Adding IntVar to typing_extensions (#3008) 2019-05-28 19:48:13 +02:00
Utkarsh Gupta
020449a1ed argparse.pyi: Allow Callable[[Text], _T] (#3013)
Fixes #2988
2019-05-27 14:39:04 +02:00
Brian Brunner
53500c8750 Make Timer args less restrictive (#3007)
Closes #3004
2019-05-23 15:08:48 +02:00
Sebastian Rittau
260369e6e7 Use typing.Text for argument types (#3000)
Also, use just str for argument types in Python 3+ branches.
2019-05-21 19:53:47 -07:00
Ran Benita
45266c9c32 Allow is_dst=None in pytz.BaseTzInfo.localize() (#3002)
See http://pytz.sourceforge.net/#problems-with-localtime
2019-05-21 10:16:30 +02:00
Viktor Roytman
07d4938251 Add missing methods to ItemsView and KeysView, including isdisjoint (#2997) 2019-05-20 02:12:22 +02:00
Saul Shanabrook
38a7f14658 Bound arguments are ordered (#2998)
The `arguments` attribute of the `BoundArguments` is specified as an "ordered, mutable mapping (collections.OrderedDict)"
not just a mutable mapping: https://docs.python.org/3/library/inspect.html#inspect.BoundArguments.arguments
2019-05-18 22:00:05 +02:00
Paul Dagnelie
d13eb937f7 Implement SupportsIndex (#2996) 2019-05-16 21:55:57 -07:00
Dominic
5b63540b4b Add sys.breakpointhook() and sys.__breakpointhook__ (#2991)
Closes #2979
2019-05-16 11:58:54 +02:00
Chad Dombrova
840631657f Add undocumented member glob.has_magic (#2972) 2019-05-16 11:28:49 +02:00
秋葉
a80066952e Add missing annotation in cmath module (#2989) 2019-05-16 11:00:44 +02:00