Commit Graph
4130 Commits
Author SHA1 Message Date
Ingmar SteenandSebastian Rittau c5713205ff requests.auth.AuthBase.__call__ deals with PreparedRequest. (#2759)
Both the argument and the return type are expected to be instances
of requests.models.PreparedRequest, not requests.models.Request.
2019-02-09 15:19:54 +01:00
Aymeric AugustinandSebastian Rittau 0b6d134795 Support the errors arg in codecs factory functions. (#2752) 2019-02-09 15:06:46 +01:00
Benjamin PetersonandJelle Zijlstra 6850b9d699 gflags: Add DEFINE_multi_enum. (#2783)
https://github.com/google/python-gflags/blob/4f06c3d0d6cbe9b1fb90ee9fb1c082b3bf9285f6/gflags/__init__.py#L800
2019-02-08 15:14:52 -08:00
Paul DagnelieandSebastian Rittau 5ef6cb7f46 Add types to some cross-platform functions in the platform library (#2781) 2019-02-08 20:28:53 +01:00
Michael J. SullivanandGitHub d8faf503ec Make SyntaxError.offset be optional (again) (#2782)
This was originally done in #2557, but got lost in #2533.
2019-02-08 11:09:18 -08:00
Paul DagnelieandJelle Zijlstra ed4323df30 Update models.pyi (#2780)
Currently, iter_lines() doesn't have any type annotations despite the types being very similar to iter_content and the types can be pretty readily derived from the source.
2019-02-07 07:21:57 -08:00
Ivan LevkivskyiandGitHub 9ffa1d8237 Update stubgen link and add a bit more info (#2779) 2019-02-03 14:47:34 +00:00
Andrew SvetlovandSebastian Rittau c45c0635c1 Add hidden and deprecated click.Command options (#2778) 2019-02-03 11:05:53 +01:00
Joel RosdahlandSebastian Rittau 3eb66ba633 Add type annotation for collections.deque.__iadd__ (#2774)
* Add type annotation for collections.deque.__iadd__

Fixes #2771.
2019-02-01 19:39:09 +01:00
Joachim JablonandJelle Zijlstra caefaa6af9 pkg_resources: fix stub for get_metadata_lines (#2776) 2019-02-01 07:58:49 -08:00
Joachim JablonandJelle Zijlstra 90d3a6e2e2 pkg_resources Add PKG_INFO str attribute for Distribution class (#2775)
To avoid
```
error: "Distribution" has no attribute "PKG_INFO"
```
This is the corresponding implementation:
https://github.com/pypa/setuptools/blob/8f82e5077e2d3aab14aa3da636f79d37ff6d7ed7/pkg_resources/__init__.py#L2531
2019-02-01 07:58:13 -08:00
Pascal CorpetandIvan Levkivskyi 75581cf7da Create stubs for Flask (#2740)
See permission in pallets/flask#2012.

Fixes #28.
2019-01-30 14:15:30 +00:00
Utkarsh GuptaandSebastian Rittau ad803e1caa builtins.pyi: Update __iadd__() and imul() in class list (#2754)
Fixes #2711
2019-01-21 21:57:15 +01:00
Frazer McLeanandSebastian Rittau 9e5816a539 Fix six.raise_from value type (#2746)
Fixes #2742
2019-01-17 20:16:38 +01:00
Hynek SchlawackandSebastian Rittau 7b69e48d1b Add SSLCertVerificationError fields (#2745) 2019-01-17 16:48:34 +01:00
ЕвгенийandSebastian Rittau 6f09ccb63d logging: inherit TimedRotatingFileHandler from Handler (#2738) 2019-01-17 13:54:59 +01:00
Michael R. ShannonandSebastian Rittau a2ecfafa98 Add missing explicit Optional to stubs for the xml.etree package. (#2734)
Fixes #2733
2019-01-17 13:50:37 +01:00
Michael NoseworthyandSebastian Rittau e8c1111d13 Fix logging.getLevelName() type hints (#2730)
`logging.getLevelName()` can take either an `int` and returns a `str` or
a `str` and returns an `int` when the level name (`str`) or level
(`int`) is one of the registered log levels. If the value passed in
isn't one of the registered log levels, it returns the string `"level
%s" % lvl` where `lvl` is the value passed in to the function.
2019-01-17 13:40:03 +01:00
Jelle ZijlstraandGitHub 78690405cf add back StopIteration.value in Python 3 (#2744)
Fixes python/mypy#6209.
2019-01-16 19:21:16 -08:00
Igor DavydenkoandJelle Zijlstra 8e6e178a5a As of Python 3.6 dump_stats method allows PathLike object to be passed. (#2741)
Replicate typings from `pstats.dump_stats` into `profile` and `cProfile`
libraries.
2019-01-15 10:27:53 -08:00
cormoranandSebastian Rittau 632eadc894 Make metavar in argparse be Optional (#2739) 2019-01-13 12:09:06 +01:00
VieldandSebastian Rittau ee20595996 Fix type of indent in JSONEncoder (#2737)
A None value for indent means the most compact representation (no newlines), it is also the default value.
2019-01-11 12:48:21 +01:00
Michael J. SullivanandGitHub f343150a6d Make ZipFile.NameToInfo use Text as the key type (#2736)
This makes it match ZipInfo.filename and also actual behavior.
2019-01-10 20:32:18 -06:00
Michael J. SullivanandGitHub c75d42ef23 Fix the type of ord on python 2 (#2735)
It looks like it got messed up in #2533
2019-01-10 19:24:51 -06:00
Tomer KerenandJelle Zijlstra be99a2a5f0 Use a more accurate type for predicates in itertools (#2732)
The only constraint on the return value of a predicate is to be "boolable".
Because `bool` recives an object in the constructor https://github.com/python/typeshed/blob/master/stdlib/2and3/builtins.pyi#L803 this is a more accurate description of a predicate.
2019-01-10 11:30:28 -08:00
Hynek SchlawackandSebastian Rittau 0854df365d Add SSLCertVerificationError for 3.7+ (#2729)
As of 3.7, ssl.CertificateError became an alias for the new
SSLCertVerificationError.
2019-01-09 09:17:39 +01:00
Alexander LyonandSebastian Rittau 2ea8abc1c7 Update sqlite3 types to include extensions (#2728) 2019-01-08 16:31:11 +01:00
Ethan SmithandSebastian Rittau ad304cb9ee Use overlapped signatures of _winapi functions (#2723)
For python/mypy#6148
2019-01-07 11:39:26 +01:00
Savo KovačevićandJelle Zijlstra eb6dbe510d Fix unittest.TestCase assert methods' argument names (#2724)
And fix assertNotAlmostEqual overloads
2019-01-05 17:31:32 -08:00
Alex SarkesianandJelle Zijlstra 893089d143 Add stubs to classes in zipfile to better enable subclassing (#2707) 2019-01-05 10:43:26 -08:00
Ilya KonstantinovandSebastian Rittau 93150dc0fa LoggerAdapter.log argument lvl -> level (#2722) 2019-01-04 09:03:56 +01:00
David EurestiandJelle Zijlstra c1953f2a00 Sync attr stubs from attrs github repo (#2720)
This include some changes like kw_only and some formatting changes.
2018-12-31 05:04:19 -08:00
Diogo Magalhães MartinsandSebastian Rittau f4aed1fd40 Fixing type for asyncio.StreamWriter reader init parameter (#2719)
Closes #2718
2018-12-28 17:56:38 +01:00
Tomer KerenandSebastian Rittau d9a202e352 Make appropriate ast methods generic (#2715)
Closes #2714
2018-12-24 20:03:09 +01:00
Savo KovačevićandSebastian Rittau 8542916231 Add missing currentframe to logging module (#2712) 2018-12-23 19:57:15 +01:00
Sebastian RittauandJelle Zijlstra eb1788ac39 Merge Python 2 and 3 builtins.pyi (#2533) 2018-12-21 07:12:41 -08:00
Juan GonzalezandSebastian Rittau 76a334daeb Complete unittest.TextTestResult stubs (#2700) 2018-12-21 08:37:33 +01:00
Dave HalterandJelle Zijlstra 2cedbc7d63 Add missing attributes of type (#2544)
All these attributes can be seen when using `dir(type)`.

In the future we should be discussing if certain methods on object (like
__eq__) should really be there. IMO this should be defined on type where it
actually also appears when using `dir`.
2018-12-20 20:01:40 -08:00
Ville SkyttäandJelle Zijlstra 9b5976e15b socket: Some more address typing (#2695) 2018-12-20 19:45:29 -08:00
Daniel MouritzenandJelle Zijlstra fb8b77e715 Set correct type for _subparsersaction.choices (#2702)
choices=_name_parser_map, see https://github.com/python/cpython/blob/a11d44056e4f9b64d28efec295e1c1c45d4cb9e1/Lib/argparse.py#L1097
2018-12-20 19:44:30 -08:00
Juan GonzalezandJelle Zijlstra c18b75b2e6 Make mypy aware of IMapUnorderedIterator (#2701) 2018-12-20 19:41:58 -08:00
Jelle ZijlstraandGitHub 46ab77eb20 loop argument to asyncio.ensure_future is Optional (#2708)
The default value is None: https://github.com/python/cpython/blob/master/Lib/asyncio/tasks.py#L616.
2018-12-20 15:24:03 -08:00
Guido van RossumandJelle Zijlstra a2c0f4b827 Add stubs for six.ensure_{binary,str,text} functions (#2704) 2018-12-19 16:07:16 -08:00
Michael LeeandGitHub 44e6b6e0d4 Add Str.kind field to typed_ast stubs (#2699)
We recently cut a new-ish release of typed-ast that [adds a new field][0]
named `kind` to the `ast27.Str` and `ast3.Str` classes. This field
stores whatever string modifiers (like `b` or `u`) were present on the
original string.

As a note, I've confirmed that this field is indeed a str (and not
bytes) for ast27's Str class.

  [0]: https://github.com/python/typed_ast/pull/49
2018-12-18 10:37:19 -08:00
Dan ČermákandSebastian Rittau f7c9677703 Add members marker and unsafe_name to pkg_resources.Requirement (#2693)
For now specify Requirement.marker as Optional[Any] (as suggested by @srittau)
as we can't import packaging.markers (pkg_resource does that via runtime magic
in pkg_resources.external)

Closes #2961
2018-12-18 16:26:56 +01:00
Andrew GaulandSebastian Rittau 6206c5a9d3 Add stubs for tabulate (#2384) 2018-12-17 19:16:25 +01:00
Ville SkyttäandSebastian Rittau 0956a24eb2 bytes/bytearray.startswith fixes (#2696) 2018-12-17 18:57:07 +01:00
Kai WilladsenandSebastian Rittau 4d85e5365f Add missing ENOTSUP alias to errno (#2692) 2018-12-17 17:46:32 +01:00
Ilya KonstantinovandSebastian Rittau 1564770456 Add pynamodb.models.Model.get_attribute and narrow down the type (#2689) 2018-12-17 17:06:42 +01:00
Philipp HahnandSebastian Rittau bf410fb9ef Logging (#2687)
* logging: Add logging.Logger().fatal()

fatal() is an alias for critical(): It is just another name for the same
implementation.

* logging: Fix logging.Logger().warn()

warn() was an alias for warning(), but got deprecated with Python3.
In Python2 warn() is just another name for the same method.
In Python3 they have their own implementations, which adds a deprecation
warning before calling the new function.

PS: LoggerAdapter in Python2 never has the warn() method, but Python3
still implements the deprecation wrapper function.
2018-12-17 15:39:01 +01:00