Vield and Sebastian 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. Sullivan and GitHub
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. Sullivan and GitHub
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 Keren and Jelle 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 Schlawack and Sebastian 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 Lyon and Sebastian Rittau
2ea8abc1c7
Update sqlite3 types to include extensions ( #2728 )
2019-01-08 16:31:11 +01:00
Ethan Smith and Sebastian Rittau
ad304cb9ee
Use overlapped signatures of _winapi functions ( #2723 )
...
For python/mypy#6148
2019-01-07 11:39:26 +01:00
Savo Kovačević and Jelle Zijlstra
eb6dbe510d
Fix unittest.TestCase assert methods' argument names ( #2724 )
...
And fix assertNotAlmostEqual overloads
2019-01-05 17:31:32 -08:00
Alex Sarkesian and Jelle Zijlstra
893089d143
Add stubs to classes in zipfile to better enable subclassing ( #2707 )
2019-01-05 10:43:26 -08:00
Ilya Konstantinov and Sebastian Rittau
93150dc0fa
LoggerAdapter.log argument lvl -> level ( #2722 )
2019-01-04 09:03:56 +01:00
David Euresti and Jelle 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 Martins and Sebastian Rittau
f4aed1fd40
Fixing type for asyncio.StreamWriter reader init parameter ( #2719 )
...
Closes #2718
2018-12-28 17:56:38 +01:00
Tomer Keren and Sebastian Rittau
d9a202e352
Make appropriate ast methods generic ( #2715 )
...
Closes #2714
2018-12-24 20:03:09 +01:00
Savo Kovačević and Sebastian Rittau
8542916231
Add missing currentframe to logging module ( #2712 )
2018-12-23 19:57:15 +01:00
Sebastian Rittau and Jelle Zijlstra
eb1788ac39
Merge Python 2 and 3 builtins.pyi ( #2533 )
2018-12-21 07:12:41 -08:00
Juan Gonzalez and Sebastian Rittau
76a334daeb
Complete unittest.TextTestResult stubs ( #2700 )
2018-12-21 08:37:33 +01:00
Dave Halter and Jelle 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ä and Jelle Zijlstra
9b5976e15b
socket: Some more address typing ( #2695 )
2018-12-20 19:45:29 -08:00
Daniel Mouritzen and Jelle 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 Gonzalez and Jelle Zijlstra
c18b75b2e6
Make mypy aware of IMapUnorderedIterator ( #2701 )
2018-12-20 19:41:58 -08:00
Jelle Zijlstra and GitHub
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 Rossum and Jelle Zijlstra
a2c0f4b827
Add stubs for six.ensure_{binary,str,text} functions ( #2704 )
2018-12-19 16:07:16 -08:00
Michael Lee and GitHub
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ák and Sebastian 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 Gaul and Sebastian Rittau
6206c5a9d3
Add stubs for tabulate ( #2384 )
2018-12-17 19:16:25 +01:00
Ville Skyttä and Sebastian Rittau
0956a24eb2
bytes/bytearray.startswith fixes ( #2696 )
2018-12-17 18:57:07 +01:00
Kai Willadsen and Sebastian Rittau
4d85e5365f
Add missing ENOTSUP alias to errno ( #2692 )
2018-12-17 17:46:32 +01:00
Ilya Konstantinov and Sebastian Rittau
1564770456
Add pynamodb.models.Model.get_attribute and narrow down the type ( #2689 )
2018-12-17 17:06:42 +01:00
Philipp Hahn and Sebastian 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
Dave Halter and Sebastian Rittau
5c69373890
macpath, os/path, posixpath and ntpath should basically be the same files ( #2637 )
2018-12-17 15:02:18 +01:00
gnattishness and Jelle Zijlstra
ea0dbfa313
Fix typo for Message.add_attachment in message.pyi ( #2697 )
2018-12-15 19:11:15 -08:00
Michael J. Sullivan and Sebastian Rittau
95afb86022
Move posix.stat_result to os.stat_result on python 3 ( #2683 )
...
In python 3, posix.stat_result is a re-export of os.stat_result, while
in python 2 it was the reverse. Update typeshed to reflect this.
2018-12-13 19:20:42 +01:00
Andrew Svetlov and Jelle Zijlstra
b9be76c255
Task.current_task() and Task.all_tasks() have an optional loop parameter ( #2690 )
2018-12-12 13:18:18 -08:00
Philipp Hahn and Sebastian Rittau
d57e8c69f3
urllib2: timeout: int -> Optional[float] ( #2685 )
2018-12-12 15:47:53 +01:00
Kostya Esmukov and Sebastian Rittau
2469a3ccda
Fix signature of ConfigParser's dict_type argument ( #2684 )
2018-12-12 08:22:31 +01:00
Sander Voerman and Sebastian Rittau
1b24d80087
Add get_loop() to asyncio.Future [Python 3.7] ( #2680 )
2018-12-09 21:37:37 +01:00
Brandt Bucher and Sebastian Rittau
0b49ce75b4
Add contextlib.nullcontext [Python 3.7]. ( #2677 )
...
Closes #2676
2018-12-08 02:55:47 +01:00
Dominik Gabi and Sebastian Rittau
dd2400df6a
Fix property annotation in third_party/2and3/boto/connection.pyi ( #2675 )
2018-12-07 23:35:37 +01:00
Utkarsh Gupta and Sebastian Rittau
b3ced5b8c0
decimal.pyi: Add overload for Decimal.__round__() ( #2674 )
...
Fixes #2528
2018-12-07 10:00:24 +01:00
Jukka Lehtosalo and Sebastian Rittau
184148611a
Fix signature of TypedDict has_key() ( #2672 )
2018-12-05 18:17:37 +01:00
Michael Lee and Sebastian Rittau
6f061bbf1e
Add 'Literal[...]' to typing_extension stubs ( #2664 )
...
This pull request adds 'Literal' to the typing_extension stubs
and serves as the dual of this PR:
https://github.com/python/typing/pull/591
For background context, here's the associated PEP draft:
https://github.com/Michael0x2a/peps/pull/1
2018-12-05 00:46:23 +01:00
Jukka Lehtosalo and GitHub
c8890b0f93
Add mypy fallback class for TypedDict methods to mypy_extensions ( #2670 )
...
This class is not defined at runtime but it's used by
mypy internally to support TypedDict methods.
Use NoReturn in argument types for better type safety
when the related mypy plugin hook is not active.
2018-12-04 18:21:58 +00:00
Sebastian Rittau and GitHub
53d8756214
Guidelines for incomplete stubs ( #2661 )
...
* Remove the guideline to use any for preliminary stubs
Closes #2648
2018-12-04 19:20:13 +01:00
Guido van Rossum and Sebastian Rittau
e08a5ac367
Tweak how ast.pyi imports typing ( #2668 )
...
When we import typeshed internally at Dropbox, somehow the fact that
these files are all stubs gets lost (it's a long story...). This
causes errors like this:
.../stdlib/2/ast.pyi:6: error: Name 'typing' already defined (by an import)
The quickest way around this is to rename the import to _typing.
2018-12-04 17:25:23 +01:00
Utkarsh Gupta and Sebastian Rittau
3e4737c683
ast.pyi: Fix return type of generic_visit() ( #2667 )
...
Fixes #2085
2018-12-04 08:02:39 +01:00
jhance and Ivan Levkivskyi
1254b30f94
[protobuf] add deterministc option ( #2666 )
2018-12-03 21:53:31 +00:00
Brandt Bucher and Sebastian Rittau
ac8f5da324
Replace Loader with PEP 451 _Loader protocol in _importlib_modulespec.pyi annotations. ( #2626 )
2018-12-03 21:26:37 +01:00
Utkarsh Gupta and Sebastian Rittau
bee236fb5d
builtins.pyi: Return complex from __(r)pow__() ( #2662 )
...
Closes #1406
2018-12-03 14:21:27 +01:00
Michael Lee and GitHub
7b76fb9b20
Make contribution guidelines state when to use (and not use) 'Any' ( #2540 )
...
This pull request modifies the contribution guidelines to clarify
when and where 'Any' should be used.
In particular, it clarifies that 'Any' is meant mainly to be used as
a "fallback" -- if it's not possible to express a certain type, if we're not
sure what the correct type in some case is, to avoid Union returns, etc...
It also explicitly notes that 'object' should be used over 'Any' when we
want to indicate that some function can accept literally anything.
Typing stubs this way probably won't impact most people, but does make
life a bit easier for people (like me) who want to restrict/forbid the
use of Any as much as possible.
2018-12-02 15:16:29 -08:00
Sebastian Rittau and GitHub
4fb22f61e4
Reference black, split long functions ( #2651 )
...
Closes #2598
2018-12-01 22:45:10 +01:00