Commit Graph
7179 Commits
Author SHA1 Message Date
Ivan LevkivskyiandJelle Zijlstra 126b3e17fd Revert #2347 (#2377) 2018-08-09 13:22:12 -07:00
Ville SkyttäandJelle Zijlstra b0e9998c99 Complete smtplib and sync with 3.5+ (#2371) 2018-08-09 11:30:24 -07:00
Devin FeeandJelle Zijlstra 047040887b fix: list_commands returns strings (#2372)
list_commands previously returned `Iterable[click.Command]` and now returns `Iterable[str]` to comply with the method's return value.
2018-08-09 10:24:23 -07:00
Ville SkyttäandJelle Zijlstra 066d8becf9 socket.create_connection source_address can be bytes or bytearray too (#2370)
* socket.create_connection source_address can be bytes or bytearray too

* Sync applicable socket.create_connection changes to socket.getaddrinfo
2018-08-09 10:02:34 -07:00
Ville SkyttäandJelle Zijlstra 850d16a668 socket.recv* return type improvements (#2363) 2018-08-09 08:07:17 -07:00
Chelsea VossandJelle Zijlstra f6e2fb4401 Allow DictReader values to be None (#2346) (#2347) 2018-08-09 08:04:44 -07:00
Michael J. SullivanandIvan Levkivskyi 0f6f2abc30 Add another undocumented mypy_extension that we are trying out (#2374) 2018-08-09 15:57:46 +01:00
Michael LeeandJelle Zijlstra bc8d68cd34 Add constructor for HTTPError in urllib2/urllib.error (#2373)
It seems that code using HTTPError previously worked by accident
because we used to accept arbitrary keyword arguments when
instantiating BaseException, or any subclass of BaseException
(see https://github.com/python/typeshed/pull/2348).

This commit adds in the correct constructor (which also lets the
user specify the arguments in keyword-argument form).

Note: I'm not very familiar with the urllib libraries, so I opted
to just add the signature and leave it up to somebody else to
fill in the types.
2018-08-08 17:05:35 -07:00
Ville SkyttäandJelle Zijlstra 5b2c8dc883 concurrent.futures: Sync with Python 3.7 (#2343) 2018-08-08 08:26:01 -07:00
Max MurinandIvan Levkivskyi e9a7f7cc0d Add missing protobuf stubs (#2368)
Added a few stubs to Protobuf descriptors. These appear in descriptor.py. These are all present in https://github.com/google/protobuf/blob/master/python/google/protobuf/descriptor.py.
2018-08-08 09:40:40 +01:00
Brandon LinandJelle Zijlstra 7c263e3935 add set_time to OpenSSL.crypto.X509Store (#2367) 2018-08-07 22:22:26 -07:00
Michael J. SullivanandJelle Zijlstra e4656b1ac6 Add undocumented trait decorator to mypy_extensions (#2369)
`@trait` has special meaning to the experimental mypyc compiler,
slightly restricting the behavior of the class in exchange for
allowing it to be multiply inherited from.
2018-08-07 22:18:00 -07:00
Daniel LiandJelle Zijlstra 631d2768d6 Add stub for pathlib2 on Python 2.7 (#2351)
pathlib2 is the Python 2.7 backport of the pathlib module from Python 3.
Hence we use the same stub file for both.

The maintainer of pathlib2 granted permission for stubs to be added in
mcmtroffaes/pathlib2#44.
2018-08-07 10:27:18 -07:00
Ville SkyttäandJelle Zijlstra 5fc149bb31 Mark GzipFile.mtime as Optional[int] (#2365)
Unlike the corresponding constructor kwarg, this is an int, not float.
2018-08-07 10:22:46 -07:00
Gary van der MerweandJelle Zijlstra c1f89a90b4 Make dataclasses available as a backported third_party library. (#2354) 2018-08-07 10:04:33 -07:00
Yusuke MiyazakiandJelle Zijlstra 9a01b817f7 Add sockets attribute to asyncio.events.AbstractServer (#2364) 2018-08-07 10:03:14 -07:00
Stig Johan BerggrenandJelle Zijlstra 92a697cabd Make BaseManager.register a classmethod (#2356) (#2357) 2018-08-07 10:02:21 -07:00
EFanZhandJelle Zijlstra dddca3b167 Add _field_defaults field to typing.NamedTuple (#2362) 2018-08-07 10:01:40 -07:00
tikkiandJelle Zijlstra 5a1ea5efb2 Minor fixes for zipfile (#2360)
* Add `is_dir` to `ZipFile`

* Allow `pathlib.Path` for `is_zipfile`
2018-08-06 09:48:53 -07:00
Ville SkyttäandJelle Zijlstra 7e62d3cdb1 Add missing sqlite3.dbapi2.Cursor return types (#2359) 2018-08-06 08:08:17 -07:00
Guido van RossumandJelle Zijlstra 1965e9dd22 Add stub for toml (#2355)
See https://github.com/uiri/toml/issues/178
2018-08-02 23:02:49 -07:00
Olmo KramerandJelle Zijlstra 4ca0a63027 Relate _curses.wrapper return type to its function arg (#2353)
`curses.wrapper` returns the return value of the function it is passed,
but its function argument is declared as `Callable[..., Any]` while its
return type is `None`. This changes the definition of `curses.wrapper`
to use a `TypeVar` that relates the return type of its function argument
to its own return type.
2018-08-01 07:57:45 -07:00
Michael J. SullivanandGitHub 8b5d4708a0 Change a use of frozenset[int] to FrozenSet[int] (#2352)
Using FrozenSet is I think preferred (because it works in general) and
I am about to propose a mypy PR that breaks this particular use.
2018-07-31 15:51:14 -07:00
Sebastian RittauandJelle Zijlstra 1c8c6ec7d9 Add type hints to werkzeug's AcceptMixin (#2349)
* Add type hints to werkzeug's AcceptMixin

* Fix typo
2018-07-28 22:01:56 -07:00
David EurestiandJelle Zijlstra 4e40b035c8 BaseException does not take keyword arguments (#2348)
Fixes #2344
2018-07-27 13:28:43 -07:00
Martin DeMelloandRebecca Chen 0c9f0d21d2 allow for unicode entity dicts in saxutils (#2345) 2018-07-24 11:18:23 -07:00
Ville SkyttäandJelle Zijlstra f5fc356928 markupbase: Fix unkown_decl typo (#2342) 2018-07-21 23:37:21 -07:00
Dominik GabiandJelle Zijlstra 14fb9df49c Fix annotation shadowed by forward reference of preoprty in datetime constructor. (#2337) 2018-07-20 17:21:32 -07:00
Sebastian RittauandJelle Zijlstra b5bddc479d Add werkzeug annotations (#2339)
* Annotate werkzeug.http

* Annotate werkzeug.datastructures.Authorization
2018-07-20 08:13:32 -07:00
Hynek SchlawackandJelle Zijlstra 7bdf4655e0 Add missing asyncio 3.7 top-level functions (#2320) 2018-07-20 08:10:52 -07:00
Sebastian RittauandJelle Zijlstra 4b8c37462e Fix decimal (#2323)
* Use Tuple field in DecimalTuple

* Remove unnecessary base classes from Decimal

* Decimal.__init__ -> __new__

* Decimal.__ne__ is not defined in Python 3

* Add Decimal.as_integer_ratio()

* Annotate DecimalException.handle()

* Correct types of Decimal method arguments

* Add missing arguments and optional markers to Decimal

* Add missing arguments to Context

* Remove spurious int from Unions with float

* Remove Context.__setattr__()

* Fix return types of Context methods
2018-07-18 21:59:08 -07:00
Linda_ppandJelle Zijlstra 0f8e0ad661 Add missing slow_callback_duration attribute to AbstractEventLoop (#2340) 2018-07-18 21:57:46 -07:00
Jelle ZijlstraandGitHub fd6f99ca2c fix mypy-selftest (#2341) 2018-07-18 21:12:37 -07:00
Jelle ZijlstraandGitHub 574807d9ea os.get_terminal_size also exists on Windows (#2338)
... at least according to https://docs.python.org/3/library/os.html#os.get_terminal_size.

Related to python/mypy#5370.
2018-07-18 10:25:12 -07:00
Omar SandovalandJelle Zijlstra 42db5ad4f7 Add missing int.__index__() signature (#2335)
This has been present since Python 2.5.
2018-07-16 15:30:06 -07:00
Jelle ZijlstraandGitHub 7d3ec1e0be Improvements to pymysql (#2220)
* don't use type comments

* split up long lines

* all the constants are ints

* fixes to pymysql stub

* drop __all__, fix tabs
2018-07-13 19:43:09 -07:00
Jelle ZijlstraandGitHub fc290167eb Fixes to boto.s3.key stub (#2317)
* replace type comments in key.pyi

* reformat the file with black

* get_contents_as_string returns bytes unless an encoding is specified

http://boto.cloudhackers.com/en/latest/ref/s3.html#boto.s3.key.Key.get_contents_as_string
2018-07-13 19:39:24 -07:00
David EurestiandJelle Zijlstra 99f25d0cd3 Click: Make group and command decorators return the correct types (#2331) 2018-07-13 19:23:47 -07:00
Sebastian RittauandJelle Zijlstra dc9f9db77f Assorted thirdparty fixes (#2332)
* pkg_resources.Distribution: Fix self arguments

* docutils: Remove spurious ellipses

* Add self argument to markupsafe.Markup.format()

While the actual signature is also "def format(*args, **kwargs)", the
implementation extracts "self" from "args" as first step.

* werkzeug: Remove methods not present during runtime

UpdateDictMixin.calls_update() and EnvironBuilder.form_property()
get deleted while constructing the respective class.

* requests: Add missing self argument
2018-07-13 19:23:23 -07:00
Ethan SmithandJelle Zijlstra cc45366ca5 Merge 2/genericpath and 2and3/genericpath (#2330) 2018-07-13 14:07:15 -07:00
Amol BhaveandJelle Zijlstra 8000513868 Change return type for click.Context.fail and click.Context.abort to NoReturn (#2326) 2018-07-11 20:16:55 -07:00
Amol BhaveandJelle Zijlstra 66e9aa644b Fix type for click.Context.exit (#2325)
click.Context.exit() calls sys.exit() and hence should be a NoReturn return type.
2018-07-11 19:58:18 -07:00
Linda_ppandJelle Zijlstra 8d13a377d4 Allow to specify None to encoding parameter of fdopen (fix #2321) (#2324) 2018-07-11 19:43:13 -07:00
David EurestiandJelle Zijlstra 2899d0a6aa Make click decorators not modify the type (#2322) 2018-07-11 12:35:05 -07:00
Ran BenitaandJelle Zijlstra 0bc98a18f0 Add stdlib/2and3/imghdr stubs (#2318)
Ad defined in https://docs.python.org/3/library/imghdr.html.
2018-07-10 08:10:25 -07:00
Ran BenitaandJelle Zijlstra cadacab088 Add missing attributes to the dateutil/relativedelta stub (#2319)
I have deduced the types from docstring & source code of the
relativedelta class.

Fixes #2269.
2018-07-10 08:08:39 -07:00
Sebastian RittauandJelle Zijlstra a38dbc6c1e Merge decimal (#2306) 2018-07-09 19:03:01 -07:00
Yusuke MiyazakiandJelle Zijlstra 5bb58af6c8 Use float instead of Union[int, float] (#2308) 2018-07-09 19:02:03 -07:00
justinpawelaandJelle Zijlstra 2a888416b2 Remove annotations from http.HTTPStatus enum members (#2314)
These type annotations are unnecessary and seem to confuse the type system.

* Remove annotation from PlistFormat enum members

Same rationale as python/typeshed#2314; same adverse effects observed.
2018-07-09 18:59:34 -07:00
Bruce MerryandGuido van Rossum c541077ffb Accept AnyStr in unittest.assertRegex (#2315)
And also in assertNotRegex, assertRegexpMatches.

Closes #2312.
2018-07-09 13:23:18 -07:00