Commit Graph

428 Commits

Author SHA1 Message Date
Philip House
04f5c5699e Merge 3.4 and 3.5 pathlib stubs (#764)
Fixes #659
2016-12-13 12:03:03 -08:00
Guido van Rossum
b46280ec78 Make FrozenSet covariant. (#769)
Follow-up for PR #726.
2016-12-13 11:40:18 -08:00
Philip House
bc252d69ac set subprocess stdout to be type Any (#581) (#761) 2016-12-13 14:23:45 +00:00
Jelle Zijlstra
97a6d27558 Make first argument to filter optional
```
$ python3.4
Python 3.4.3 (default, Nov 17 2016, 01:08:31) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list(filter(None, [False, True]))
[True]
>>> 
```
2016-12-12 11:31:12 -08:00
Daisuke Miyakawa
57aa1923d5 Make sqlite3's Connection.rollback() return None (#758)
Fixes #747.
2016-12-07 16:22:47 -08:00
George King
af5b5c83fd Make shutil.copytree stub's ignore parameter optional. (#740)
* Make `shutil.copytree` stub's `ignore` parameter optional.

* python2.7 shutil.copytree `ignore` annotated as optional.
2016-12-07 14:47:34 -08:00
George King
e7db9cda4d Add stub for os.path.commonpath (new in 3.5). (#738)
* Add stub for os.path.commonpath (new in 3.5).
2016-12-07 14:47:04 -08:00
George King
dccc29bc2f Add None to type union for subprocess.Popen.communicate input. (#743)
* Add `None` to type union for `subprocess.Popen.communicate` stub's `input` parameter.

* subprocess.communicate `input` annotated as `Optional[AnyStr]` for both 2.7 and 3.x; `timeout` as `Optional[float]`.
2016-12-07 14:46:34 -08:00
Daisuke Miyakawa
b33c2c6158 Introduce multiprocessing.freeze_support() (#749) 2016-12-07 13:30:14 -08:00
George King
00e4027b77 Add idx parameter to JSONDecoder.raw_decode. (#742) 2016-12-07 13:19:27 -08:00
George King
085c3f9915 Make json.load, json.loads stubs object_hook parameter optional. (#741) 2016-12-07 13:14:49 -08:00
Jon Dufresne
2b022d18a4 Add stub for unittest.mock (#731)
Stub generated by stubgen.

Fixes #372
2016-12-07 08:05:01 -08:00
Onno Kortmann
69ea0ad43f Iteration and fetch* fixes to the sqlite3.Cursor type (#663)
- Cursor is an Iterator of Any now, and .__iter__(..) and .__next__(..)
  have been changed / made explicit to reflect this.

- .fetchall(..)/.fetchmany(..)/.fetchone(..) return (lists of) Anys
  instead of tuples.

As per discussion in PR #663, the output of fetching values from the
cursor can be customized with a custom assignment to
.row_factory. Therefore the correct return type for fetching is Any and
not tuple.
2016-12-06 08:17:21 -08:00
Danny Weinberg
3855e7023f Ignore a stub class that extends Any (#745)
Ignore a stub class that extends Any so that programs can use `--disallow-subclassing-any`.
2016-12-05 14:30:14 -08:00
Danny Weinberg
679a6e5669 Give shutil.which a return annotation (#744) 2016-12-05 11:41:53 -08:00
thomascellerier
d18a225ec2 Fix type for base64.b64encode, it should accept str or bytes (#736)
Fixes #735
2016-12-05 11:15:40 -08:00
Calen Pennington
5ba7abc559 Add GenericMeta (so that classes can be Generic when they already hav… (#703) 2016-12-02 12:09:59 -08:00
Jelle Zijlstra
ed4f9e9b0b urlencode: change parameters to Any instead of AnyStr (#715)
The implementation of this function calls str() on all arguments, so it accepts
any object (https://hg.python.org/cpython/file/3.5/Lib/urllib/parse.py#l801).

This was discussed on the mypy gitter chat.
2016-12-01 11:38:23 +00:00
Josiah Boning
c9ad4b8dc0 Have frozenset inherit from FrozenSet (#726)
Fixes python/mypy#2514
2016-11-30 17:58:11 -08:00
Łukasz Langa
85807ed72a logging.Formatter attributes fixed (#721)
Fixes #720.

Related changes: used a NamedTuple for time.struct_time on Python 3, used
sys.version selectors for proper typing of #716, added missing *Style classes
to logging on Python 3.
2016-11-30 09:09:05 -08:00
rymdhund
eb90eddd8f Fix urllib.parse.urlencode signature (#702)
Fixes #700
2016-11-24 11:45:20 +00:00
Richard Eames
4f567d993b Add missing self parameters (#695)
A few methods are missing the `self` parameter in  `urllib.RobotFileParser`
2016-11-23 11:37:39 +00:00
Ryan C. Thompson
f36d7a3cd3 Multiprocessing fixes (#687)
* Fix type declarations for multiprocessing.pool.ThreadPool

The existing incomplete type declarations were replaced by a copy of
multiprocessing.Pool's declarations, suitably modified.

Fixes #683.

* Change iterable type to Iterable[Iterable[Any]] in starmap

multiprocessing.Pool and multiprocessing.pool.ThreadPool have starmap
and related methods, where the iterable argument is expected to yield
iterables. The type declarations now reflect this.
2016-11-12 17:31:54 -08:00
jgarvin
88350e7f47 Add ns accurate times in os.stat_result (#686) 2016-11-12 17:20:00 -08:00
Onno Kortmann
c4125739e5 The timeout argument to Queue.{get,put} may be None (#682)
Python 2 and 3.
2016-11-11 10:29:52 -08:00
Hong Minhee
5fc1b4b948 Add missing MutableSet abstract base class (#680) 2016-11-10 14:10:10 -08:00
Guido van Rossum
ec4987fa5d Fix AwaitableGenerator inheritance; Awaitable is the return value, not the yielded value (#679) 2016-11-10 11:57:31 -08:00
Elazar Gershuni
dfe4bf0a70 Fix broken sys.version_info check in importlib/abc.pyi (#673)
Fixes #672.
2016-11-09 08:43:06 -08:00
Hong Minhee
13b1cdc834 Stubs for collections.abc (#671)
The ABC types were moved to collections.abc in 3.3 (but still exist in collections too).
2016-11-08 21:37:33 -08:00
Roy Williams
1b30761802 Small changes by @rowilla to collections.pyi and urllib/requests.pyi.
(Extracted from PR #530.)
2016-11-08 19:40:10 -08:00
Jon Dufresne
4b369945d0 Change struct fmt argument to str instead of AnyStr (#669)
Switching between a bytes fmt and str fmt argument can cause a BytesWarning
when running Python with the -b command line argument.
2016-11-07 16:58:25 -08:00
TrueBrain
341c4edc37 Args is a predefined attribute on BaseException, and always Tuple[Any, ...] (#666) 2016-11-05 16:33:58 -07:00
TrueBrain
cecb64b59f In TextIO, 'errors' is Optional (#665) 2016-11-05 15:02:35 -07:00
Guido van Rossum
53014497c4 Add Coroutine. Fix signature for Generator.throw(). (#656) 2016-11-04 11:46:50 -07:00
Guido van Rossum
7c20adb715 Fix memoryview stub (#651)
Fixes python/mypy#2390
2016-11-02 17:18:44 -07:00
Elazar Gershuni
090667c7b2 fix self in urllib (#643) 2016-10-30 15:01:46 -07:00
Elazar Gershuni
252a772b67 fix self in ssl, unittest and multiprocessing/managers (#644) 2016-10-30 12:20:03 -07:00
Kai Lautaportti
b1c545cee6 Mark use of tzinfo optional in the datetime module. (#637) 2016-10-30 12:00:18 -07:00
TrueBrain
15ec66cdd6 Consider __doc__ always Optional. (#641)
python/mypy#2380 showed a discrepancy between object and FunctionType in stdlib2. The first defined __doc__ to be str, the second Optional[str]. As FunctionType depends on object, this is no longer valid.

As suggested by @gvanrossum in python/mypy#2380, all __doc__ should be considered Optional.

(Final verdict was just to remove most __doc__ attributes since it's inherited from object.)
2016-10-30 11:48:23 -07:00
Elazar Gershuni
1d47c6fdb8 Directly import ABCMeta (and abstractmethod) from abc (#640)
This change is needed for mypy/#2365.
2016-10-30 11:30:22 -07:00
Elazar Gershuni
7a623f2cea Dedicated TypeVar for type.__subclasses__ (#639) 2016-10-30 10:29:51 -07:00
Dima Gerasimov
58d864d726 Add __enter__ and __exit__ to Pool stub (#642) 2016-10-30 10:18:51 -07:00
Guido van Rossum
c3ddd3c5f2 Improve __subclasses__() signature. Fixes python/mypy#2236. 2016-10-27 17:31:03 -07:00
Filip Figiel
d60bea14f6 Improve concurrent.futures.wait function stub (#634) 2016-10-26 07:19:24 -07:00
Gerhard Hagerer
0c2e9cf3be Added variable types for resources.pyi (#632)
Just some output from stubgen.pyi
2016-10-26 07:16:48 -07:00
Kai Lautaportti
c8f324298d Added typing for os.cpu_count() (#628) 2016-10-25 10:46:33 -07:00
Kai Lautaportti
f6bbc46c35 Fix functools.lru_cache() type hint to allow maxsize=None (#627) 2016-10-22 15:45:57 -07:00
Elazar
7224b67532 Remove @builtinclass (#626) 2016-10-22 12:25:02 -07:00
Matthias Kramm
7d80824092 Better definition for xml/sax/__init__.pyi. (#621)
Also, merge 2.7/xml/sax and 3/xml/sax into 2and3/xml/sax.
2016-10-19 15:30:25 -07:00
Kai Lautaportti
8fec896898 Added RecursionError to builtins for Python >= 3.5 (#620)
Closes #619.
2016-10-19 15:06:10 -07:00