Commit Graph

2253 Commits

Author SHA1 Message Date
Ville Skyttä
f5fc356928 markupbase: Fix unkown_decl typo (#2342) 2018-07-21 23:37:21 -07:00
Dominik Gabi
14fb9df49c Fix annotation shadowed by forward reference of preoprty in datetime constructor. (#2337) 2018-07-20 17:21:32 -07:00
Sebastian Rittau
b5bddc479d Add werkzeug annotations (#2339)
* Annotate werkzeug.http

* Annotate werkzeug.datastructures.Authorization
2018-07-20 08:13:32 -07:00
Hynek Schlawack
7bdf4655e0 Add missing asyncio 3.7 top-level functions (#2320) 2018-07-20 08:10:52 -07:00
Sebastian Rittau
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_pp
0f8e0ad661 Add missing slow_callback_duration attribute to AbstractEventLoop (#2340) 2018-07-18 21:57:46 -07:00
Jelle Zijlstra
fd6f99ca2c fix mypy-selftest (#2341) 2018-07-18 21:12:37 -07:00
Jelle Zijlstra
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 Sandoval
42db5ad4f7 Add missing int.__index__() signature (#2335)
This has been present since Python 2.5.
2018-07-16 15:30:06 -07:00
Jelle Zijlstra
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 Zijlstra
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 Euresti
99f25d0cd3 Click: Make group and command decorators return the correct types (#2331) 2018-07-13 19:23:47 -07:00
Sebastian Rittau
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 Smith
cc45366ca5 Merge 2/genericpath and 2and3/genericpath (#2330) 2018-07-13 14:07:15 -07:00
Amol Bhave
8000513868 Change return type for click.Context.fail and click.Context.abort to NoReturn (#2326) 2018-07-11 20:16:55 -07:00
Amol Bhave
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_pp
8d13a377d4 Allow to specify None to encoding parameter of fdopen (fix #2321) (#2324) 2018-07-11 19:43:13 -07:00
David Euresti
2899d0a6aa Make click decorators not modify the type (#2322) 2018-07-11 12:35:05 -07:00
Ran Benita
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 Benita
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 Rittau
a38dbc6c1e Merge decimal (#2306) 2018-07-09 19:03:01 -07:00
Yusuke Miyazaki
5bb58af6c8 Use float instead of Union[int, float] (#2308) 2018-07-09 19:02:03 -07:00
justinpawela
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 Merry
c541077ffb Accept AnyStr in unittest.assertRegex (#2315)
And also in assertNotRegex, assertRegexpMatches.

Closes #2312.
2018-07-09 13:23:18 -07:00
Bertrand Bonnefoy-Claudet
f582b53ff7 Add stub file for click.testing (#2243)
Click already had stubs but not for the `testing` submodule.

I used stubgen and then narrowed the types when it was easy.  I left
`Any` where more work was necessary.
2018-07-05 20:40:48 -07:00
NAKAMURA Yoshitaka
c78b9eb022 Allow IMAP4.search() to accept "None" charset as docs say (#2310) 2018-07-04 23:24:51 -07:00
Josh Holland
347595bafb Make argument to sys.settrace optional (#2309) 2018-07-04 10:15:30 -07:00
Sebastian Rittau
853c6e88a9 Merge stdlib/3.3 into stdlib/3 (#2297) 2018-07-03 18:56:28 -07:00
Sebastian Rittau
2a36b4cf01 Move asyncio from 3.4 to 3 (#2307) 2018-07-03 09:06:04 -07:00
Steven Karas
d4c15011e4 add __new__ to tuple in python2 (#2304)
this solves #2091 when checking Python 2 code (#2092 only fixed it for Python 3).
2018-07-03 08:18:01 -07:00
Sebastian Rittau
9229dd8f0c Merge stdlib/3.4 into stdlib/3 (#2303)
* Merge stdlib/3.4 into stdlib/3

* Move asyncio back to 3.4 for now
2018-07-03 08:13:54 -07:00
Yusuke Miyazaki
1ae2ba0fbe Use sys.platform instead of comments (#2286) 2018-07-03 08:13:04 -07:00
Yusuke Miyazaki
6192cce9d9 Avoid using string literals in type annotations (#2294) 2018-07-02 20:23:29 -07:00
Sebastian Rittau
25ad95de4f Drop Python 3.3 support from asyncio and ipaddress (#2293) 2018-07-02 20:22:58 -07:00
Sebastian Rittau
d3865574a9 Remove asyncio.tasks.async (#2296)
While this alias for ensure_future existed prior to Python 3.7, it
causes a syntax error when parsing it with Python 3.7 or above.
2018-07-02 14:34:18 -07:00
Sebastian Rittau
ce1504d9e9 Add missing cls argument to FileFinder.path_hook() (#2299) 2018-07-02 13:19:04 -07:00
Sebastian Rittau
e767c38c37 Move lineno and col_offset to ast.AST (#2298)
Also, mark AST._attributes and _fields as class vars.

`lineno` and `col_offset` were previously defined on a few sub-classes of `AST`, e.g. `expr`, even though https://docs.python.org/3/library/ast.html explicitly states that `AST` has these two attributes. These attributes are only present if they were supplied as arguments to the constructor, but the same is true for the subclasses.
2018-07-02 13:18:38 -07:00
Ethan Smith
236ed3f731 Add genericpath stub (#2300)
To backport `os.path.commonpath` in mypy I needed to use genericpath. It seems unchanged since 3.4, and the `same*` functions were added in 3.4. (checked via comparing the `__all__`s of the source in 2.7, 3.4, and 3.7.)
2018-07-02 13:13:38 -07:00
Sebastian Rittau
6a18bd3ec2 Add missing self to TestCase.addCleanup() (#2301) 2018-07-02 12:12:59 -07:00
Yusuke Miyazaki
02192ecaf0 Install pytype from PyPI (#2302)
Fixes #2295
2018-07-02 11:57:20 -07:00
Yusuke Miyazaki
581705d9ee Prefer to use ellipsis over pass (#2292) 2018-06-28 10:29:45 -07:00
Sebastian Rittau
187aaaced9 Use protocols for shutils.copyfileobj() (#2291)
See https://github.com/python/typing/issues/564 for background.
2018-06-28 10:28:24 -07:00
Sebastian Rittau
7ebd609643 Add pyexpat and xml.parsers (#2276) 2018-06-28 10:26:17 -07:00
potykion
f35c5d1349 Jinja2 async support (#2278) 2018-06-28 10:24:37 -07:00
Sebastian Rittau
b261b228ba Merge Python 2 and 3 shutil (#2259)
* Drop support for Python 3.3
* Merge Python 2 and 3 shutil
* Marked some arguments optional
* Changed callback return type from None to Any for more flexibility
2018-06-27 20:42:58 -07:00
Yusuke Miyazaki
86883d3df9 Remove unused import statements (#2282) 2018-06-27 20:14:57 -07:00
Philipp Hahn
f8041d08db logging.BASIC_FORMAT also for python2.7 (#2283) 2018-06-27 20:14:06 -07:00
Philipp Hahn
ee07115c96 urllib2.build_open() accepts instances and classes (#2284)
<https://docs.python.org/2/library/urllib2.html#urllib2.build_opener>
> handlers can be either instances of BaseHandler, or subclasses of
> BaseHandler (in which case it must be possible to call the constructor
> without any parameters).
2018-06-27 20:13:46 -07:00
Philipp Hahn
4e3b8f7e15 tty.set*() accepts fd or file object (#2285)
<https://docs.python.org/2/library/tty.html>
> ... requires the termios module ...

<https://docs.python.org/2/library/termios.html#module-termios>
> All functions in this module take a file descriptor fd as their first
> argument. This can be an integer file descriptor ... or a file object,
2018-06-27 20:12:04 -07:00
Nipunn Koorapati
b7df5a670a Add type stubs for google.protobuf.service (#2187) 2018-06-27 15:38:29 -07:00