Jelle Zijlstra and Matthias Kramm
0080017d02
fill out bz2 stub ( #1728 )
...
- add a default value to ...
- add some missing version checks
- add some missing arguments
2017-11-13 06:55:43 -08:00
Nathan Henrie and Jelle Zijlstra
87fca814b1
addr should be Tuple[str, int], not str ( #1740 )
...
I think `addr` here should also be `Tuple[str, int]`, the same change made to `sendto` in [this pr merged a few months ago](https://github.com/python/typeshed/commit/0e26c1f9361bd2d57b9f361c4fbd8185243afb21#diff-d21efb8da2d73c6c7c769270b387cd47 ).
2017-11-12 23:14:16 -08:00
Alex Willmer and Jelle Zijlstra
55f15427bd
Refine stdlib commands module (add mkarg(), mk2arg(), correct get*()) ( #1739 )
2017-11-12 22:44:51 -08:00
FichteFoll and Jelle Zijlstra
a44de46a00
use_builtin_types is optional for plistlib.load ( #1738 )
2017-11-11 16:54:11 -08:00
Jelle Zijlstra and Matthias Kramm
97be335160
don't import enum in Python 2 ( #1724 )
...
* don't import enum in Python 2
Fixes a pytype issue from #1720 .
* move enums together
2017-11-10 10:23:22 -08:00
Jelle Zijlstra and Matthias Kramm
9390a49600
complete multiprocessing.connection stub ( #1716 )
...
Adds additional public members based on https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L10 and https://docs.python.org/3/library/multiprocessing.html#multiprocessing-listeners-clients .
I found some discrepancies in the docs while adding these stubs and filed python/cpython#4304 to address them.
2017-11-09 10:40:49 -08:00
Jelle Zijlstra and Matthias Kramm
324f1761f4
Change more defaults to ... ( #1727 )
2017-11-09 10:32:17 -08:00
Josh Staiger and Jelle Zijlstra
fd25e534ad
Add default timeout for Condition.wait_for ( #1726 )
...
Fixes:
- Too few arguments for "wait_for" of "Condition"
when timeout is not specified.
2017-11-09 10:12:33 -08:00
Jelle Zijlstra and Matthias Kramm
54dd6ba27c
Change numerous default values to ... ( #1722 )
...
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Daniel Axtens and Matthias Kramm
66821993f6
Fix email header types ( #1472 )
...
Some email header operations can operate on or return a Header object as well as a string.
2017-11-09 06:03:11 -08:00
Kenny Do and Matthias Kramm
26ea6c0740
pkgutils.walk_packages takes optional list of str for path ( #1725 )
2017-11-09 05:57:29 -08:00
Jelle Zijlstra and Matthias Kramm
eaf8972e48
complete Python 3 gzip stub ( #1723 )
...
* complete python 3 gzip stub
* IOBase.closed is read-only
2017-11-09 05:56:55 -08:00
Brandon W Maister and Jelle Zijlstra
a1238294d7
Remove unnecessary optionality for requests.Session ( #1658 )
...
Current code that initializes the things I've changed, to demonstrate that the
object is initialized this way:
* headers: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L345
* proxies: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L354
* hooks: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L357
* params: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L362
* cookies: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L388
from what I can tell nothing in the official requests API ever creates a
session other than through `__init__`.
2017-11-08 19:53:56 -08:00
Grzegorz Śliwiński and Jelle Zijlstra
9439ec4e4f
click.echo message arg type to follow click's documentation ( #1698 )
...
str is not unicode on Python 2 while Text is a proper alias for unicode on python 2 and str on python 3
closes #1691
2017-11-08 19:41:36 -08:00
Henri Bai and Jelle Zijlstra
44f7869c80
Fix blake2 binding ( #1663 )
...
* Fix blake2 binding
Currently calling `hashlib.blake2b` results in the following type errors:
Cannot instantiate abstract class '_BlakeHash' with abstract attributes 'copy', 'digest', 'hexdigest' and 'update'
Missing positional arguments "data", "key", "salt", "person", "fanout", "depth", "leaf_size", "node_offset", "node_depth", "inner_size", "last_node" in call to "_BlakeHash"
* Additional changes to reflect the hashlib implementation
Modifies the type signatures of:
* blake2b
* blake2s
* sha3_224
* sha3_256
* sha3_384
* sha3_512
* shake_128
* shake_256
To reflect the types that are implemented in the standard library.
These should be exposed as `type`s instead of `builtin_function_or_method`s.
e.g.
In [40]: type(hashlib.blake2b)
Out[40]: type
In [41]: type(hashlib.md5)
Out[41]: builtin_function_or_method
2017-11-08 19:39:55 -08:00
Sebastian Rittau and Jelle Zijlstra
9656febaee
Merge style guide from README.md into CONTRIBUTING.md ( #1696 )
2017-11-08 09:02:59 -08:00
Luka Sterbic and Jelle Zijlstra
0a9a2b6470
_asdict returns OrderedDict in 3.1 and up ( #1690 )
2017-11-08 08:50:36 -08:00
Sebastian Steenbuck and Jelle Zijlstra
2551b76bde
Replace default strings ' ' with ... ( #1721 )
...
This fixes a problem with pytype.
2017-11-08 08:49:54 -08:00
FichteFoll and Jelle Zijlstra
f933b9384c
Refine str.maketrans and str.translate ( #1613 )
...
str.translate requires a Mapping or Sequence (in essence, anything
with __getitem__), not a Dict.
str.maketrans in the one-argument form only converts character string
keys to their unicode ordinal, leaving any of the values untouched.
This mapping may use both integers or strings as keys at the same time.
str.maketrans in the multi-argument form returns a dict with any of the
values str, int or None, as recognized by str.translate.
2017-11-07 18:55:05 -08:00
Alex Willmer and Jelle Zijlstra
c7bc0bdb00
Add BaseException.__getitem__ & __getslice__ ( #1719 )
...
Refs python/mypy#4215
Fixes false positive
error: Value of type Exception is not indexable
2017-11-07 12:57:51 -08:00
Jelle Zijlstra and Guido van Rossum
735abe68dd
remove all lxml stubs for now ( #1664 )
...
Fixes #525 .
2017-11-07 07:54:01 -08:00
Sebastian Steenbuck and Matthias Kramm
ef46c95c9e
Add List to the typing imports and order the imports ( #1717 )
...
List is used but not imported. According to PEP-484 "Suggested syntax for Python 2.7 and straddling code" it should be imports.
"Like other type comments, any names used in the annotations must be imported or defined by the module containing the annotation.".
Also order the typing import list, because it looks nicer.
2017-11-07 06:42:23 -08:00
Alan Du and Jelle Zijlstra
275d9b5818
Python 3 multiprocesisng synchronization stubs ( #1678 )
...
* Add multiprocessing.Array to Python 3 stub
* Add Pipe and Connection type
* Add synchronize type-stub
* Add multiprocessing Exceptions
* Update context with synchronization primitives
* Code review comments
* Add acquire and release from _make_method
* Remove Array stub
* add missing Optional
2017-11-06 23:07:02 -08:00
Roy Williams and Jelle Zijlstra
f4e3657c57
Allow subprocess functions to accept PathLike objects in 3.6 and above ( #1713 )
...
* Allow subprocess functions to accept PathLike objects in 3.6 and above
* Split up _PATH from _TXT in subprocess
2017-11-06 10:28:08 -08:00
Josh Staiger and Jelle Zijlstra
8b367c770b
Make pkgutil.get_data return Optional[bytes] ( #1714 )
...
As per the docs (and implementation):
- https://docs.python.org/3/library/pkgutil.html#pkgutil.get_data
If the package cannot be located or loaded ... then None is returned.
2017-11-05 14:00:51 -08:00
Josh Staiger and Jelle Zijlstra
bc2f88d6ee
Make Executor.__enter__ self and return types match ( #1711 )
...
Specifically, this solves a problem in code such as:
with ThreadPoolExecutor() as p: ...
Where the p variable would be typed as an abstract `Executor`, rather than the specific `ThreadPoolExecutor` as expected.
2017-11-04 13:56:55 -07:00
anentropic and Jelle Zijlstra
05f527c089
BaseException.__init__ accepts **kwargs ( #1704 )
2017-11-03 23:10:34 -07:00
Grzegorz Śliwiński and Jelle Zijlstra
81191e49a3
click.*option function parameter to accepts bool and Text ( #1699 )
...
This follows documentation and code which allows to use both bool and Text.
Update all the prompt arguments for all *option functions in click.decorators module
since they're mostly proxying the call to option setting desired defaults.
closes #1693
2017-11-03 22:52:12 -07:00
Zac Hatfield Dodds and Jelle Zijlstra
89cfa64577
Complete Py3 stub for sre_constants ( #1709 )
2017-11-03 22:48:10 -07:00
rchen152 and Matthias Kramm
85e75c9a6a
Fix a parameter type in threading.Thread.__init__ ( #1706 )
2017-11-01 15:41:10 -07:00
Patrick Valsecchi and Jelle Zijlstra
aafa556a10
Add context manager methods to requests.Response ( #1701 )
...
* Add context manager methods to requests.Response
* Simplified the requests.Response.__exit__ signature
2017-11-01 08:19:43 -07:00
Guido van Rossum and GitHub
77c06d411c
Remove type annotation from some Loader args ( #1695 )
...
There were two problems AFAICT:
- There are multiple Loader classes without a common base class,
so this should really be a union or a protocol.
- The argument is supposed to be a class, not an instance.
Rather than figuring out a fix (which would probably require some
nasty refactoring) I'm just going back to the old situation where
these arguments are implicitly annotated with `Any`.
See also https://github.com/python/typeshed/pull/1657#pullrequestreview-72049880
2017-10-27 09:30:16 -07:00
Grzegorz Śliwiński and Guido van Rossum
fcf1d38c57
fix typo in dateutil.tz importing tzutc as tzutz ( #1694 )
2017-10-27 07:40:16 -07:00
Ilya Konstantinov and Jelle Zijlstra
ab9733b448
Support for response hooks in requests ( #1674 )
2017-10-26 10:56:05 -04:00
Sebastian Rittau and Jelle Zijlstra
cbea45f19a
Fix style example ( #1689 )
...
* Replace `self` with `cls` in classmethod
* Group classmethods together, as in the actual stub
* Use float instead of Union[int, float] in coding style example
2017-10-26 10:54:18 -04:00
Sebastian Rittau and Jelle Zijlstra
87ef6b8d53
Add stub for unittest.mock.patch.multiple() ( #1686 )
...
* Add stub for unittest.mock.patch.multiple()
* Use ... for default arguments in unittest.mock.patch() et al.
* Tighten type of create argument to patch() et al.
2017-10-26 00:57:56 -04:00
Sebastian Rittau and Jelle Zijlstra
0b0a9588f3
Document default argument syntax ( #1687 )
2017-10-26 00:57:46 -04:00
Matěj Cepl and Guido van Rossum
8ead136300
IMAPlib stub. ( #1685 )
...
Fixes #295 .
2017-10-25 16:37:04 -07:00
Matthew Wright and Jelle Zijlstra
0b721b7af5
Update type of "throw" method of generators to reflect that it can return a value ( #1672 )
2017-10-25 16:54:18 -04:00
Ilya Konstantinov and Jelle Zijlstra
9a10c74345
requests.Session.headers and proxies not optional ( #1676 )
...
```
>>> import requests
>>> s = requests.session()
>>> s.headers
{'User-Agent': 'python-requests/2.18.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}
>>> s.proxies
{}
```
2017-10-25 16:50:59 -04:00
Guido van Rossum and Matthias Kramm
994cfb5369
Make PY2 enum more like PY3 enum, fixing bug in unique() ( #1668 )
2017-10-25 09:47:45 -07:00
hashstat and Matthias Kramm
c366a1be55
Merge v2 and v3 array stubs ( #1670 )
...
See #1608
2017-10-25 09:46:25 -07:00
Sally and Matthias Kramm
37f1bf54a5
Fix type of source for xml.sax.parse ( #1666 )
...
Fixes https://github.com/python/typeshed/issues/1655
2017-10-25 09:45:48 -07:00
Martin DeMello and Matthias Kramm
817c270c32
Clean out the pytype blacklist ( #1667 )
2017-10-24 10:38:34 -07:00
Carl Meyer and Jelle Zijlstra
9e76d44b09
Fix sys.setprofile annotation. ( #1679 )
...
`sys.setprofile(None)` is valid, and is in fact the only way to clear a profiler once set.
2017-10-23 15:26:58 -04:00
marienz and Jelle Zijlstra
c888bc8a1a
Fix distutils.setup's cmdclass argument ( #1682 )
2017-10-22 15:47:31 -04:00
Wilfred Hughes and Matthias Kramm
72e24b8443
Add basic type annotations for YAML load functions ( #1657 )
...
These are probably the most common YAML functions, so this should be useful even without type declarations on the rest of the package.
2017-10-20 10:18:47 -07:00
Ethan Smith and Guido van Rossum
b7dc041f44
reexport names in 3/dateutil.tz ( #1673 )
...
This was missed in #1669 , and should completely fix #1665 .
2017-10-15 13:32:36 -07:00
Jelle Zijlstra and Guido van Rossum
c10dc67ad2
Re-export names in dateutil.tz ( #1669 )
...
Fixes #1665 .
2017-10-12 17:57:12 -07:00
hashstat and Jelle Zijlstra
6accffca28
popen() is function, not method, so remove self argument ( #1671 )
2017-10-12 12:16:14 -07:00