Jelle Zijlstra and Jukka Lehtosalo
392eb4aa5a
add stubs for Python 2 profile and cProfile ( #699 )
...
* add stubs for Python 2 profile and cProfile
Partially fixes #531 . Contrary to the Python 2.7 docs at
https://docs.python.org/2/library/profile.html#module-cProfile ,
these modules do not have exactly the same interface. For
example, profile.Profile() does not have an enable() method.
* profile stubs: move to 2and3, add __init__, use private names for typevars
2016-12-01 11:51:41 +00:00
Naomi Seyfer and Jukka Lehtosalo
38d356503d
Increase compatibility of itsdangerous URLSafeSerializerMixin & Serializer ( #712 )
...
I'm preparing a PR to mypy that further formalizes and improves the rules for
which functions are "compatible" with each other, both for subtyping and for
assignment. This is the one place in the stubs that violates the new rules but
not the old: the supertype `Serializer` can take an optional positional argument
called `serializer` to `load_payload`, but until this diff the mixin used to
implement it could not, but rather could only take `serializer` as a named
argument, through its **kwargs.
2016-12-01 11:48:56 +00:00
Jelle Zijlstra and Jukka Lehtosalo
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 and Guido van Rossum
c9ad4b8dc0
Have frozenset inherit from FrozenSet ( #726 )
...
Fixes python/mypy#2514
2016-11-30 17:58:11 -08:00
Lukasz Langa
d1081b94ee
[logging] Fix forward references
2016-11-30 10:48:10 -08:00
Łukasz Langa and Guido van Rossum
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
Roy Williams and Łukasz Langa
0391e72a6e
Expose pytz.UTC as an instance as opposed to as a class ( #723 )
...
* Expose pytz.UTC as an instance as opposed to as a class
pytz shadows UTC after declaring it with a singleton:
https://github.com/newvem/pytz/blob/master/pytz/__init__.py#L135
This fixes https://github.com/python/typeshed/issues/710
2016-11-29 23:04:53 -08:00
Roy Williams and Łukasz Langa
1dff8e4a45
Add stubs for markupsafe ( #718 )
...
* Add stubs for markupsafe
* Add more specific types for markupsafe
This is needed for Flask. Permission was given here:
https://github.com/pallets/itsdangerous/issues/69#issuecomment-246516942
2016-11-29 13:32:12 -08:00
Guido van Rossum and Łukasz Langa
bbbf1d8c7a
PurePath.parent[s] should be properties ( #706 )
...
PurePath.parent[s] should be properties
2016-11-28 14:01:22 -08:00
Guido van Rossum and Łukasz Langa
33c0134b70
Move PY2 werkzeug stubs to 2/ directory.
...
We no longer use 2.7/ since that is the only version.
2016-11-28 13:48:19 -08:00
Peter Amstutz and Łukasz Langa
d0f6a05793
Fix logging.Logger.isEnabledFor() to return bool instead of None.
2016-11-28 13:46:40 -08:00
Roy Williams and Guido van Rossum
021b162bc9
Add stubs for werkzeug ( #530 )
2016-11-28 10:50:57 -08:00
Lukasz Langa
16c3af3068
Update README.md to mention 3.6 and --fast-parser
2016-11-26 20:27:50 -08:00
Lukasz Langa
5145a1119d
Complete stubs for Click 6.6 on Python 3.
...
Put under 3.6 as they use the wonderful PEP 526 syntax for annotating
class/instance members.
2016-11-26 20:19:51 -08:00
Lukasz Langa
ab4ad3fe9d
Make tests run with 3.6 --fast-parser, too
2016-11-26 20:17:28 -08:00
rymdhund and Jukka Lehtosalo
eb90eddd8f
Fix urllib.parse.urlencode signature ( #702 )
...
Fixes #700
2016-11-24 11:45:20 +00:00
Roy Williams and Jukka Lehtosalo
33b81b9e2b
Add MutableSet to collections ( #691 )
2016-11-24 11:39:00 +00:00
Hugo and Jukka Lehtosalo
b9733f5717
Formatting and typos ( #707 )
2016-11-24 09:31:10 +00:00
Naomi Seyfer and Jukka Lehtosalo
c134fe7638
handlers should be an optional argument of logging.basicConfig() (#704 )
2016-11-24 09:21:10 +00:00
Jelle Zijlstra and Jukka Lehtosalo
b10125cd7d
commands: add python 2 pyi file ( #698 )
...
Partially fixes issue #531
2016-11-23 12:14:03 +00:00
Anders Kaseorg and Jukka Lehtosalo
e13f2c739d
Add Iterable base class to tarfile.TarFile ( #693 )
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2016-11-23 11:49:44 +00:00
Jelle Zijlstra and Jukka Lehtosalo
7ac78b163d
Remove BaseException.with_traceback in py2 ( #697 )
...
This method doesn't exist in Python 2; it was added in Python 3. See https://docs.python.org/2/library/exceptions.html#exceptions.BaseException versus https://docs.python.org/3/library/exceptions.html#BaseException.with_traceback .
2016-11-23 11:42:59 +00:00
Jelle Zijlstra and Jukka Lehtosalo
9bc07e7b9d
fix typo in list.__delslice__ ( #696 )
2016-11-23 11:41:33 +00:00
Richard Eames and Jukka Lehtosalo
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 and Guido van Rossum
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 and Guido van Rossum
88350e7f47
Add ns accurate times in os.stat_result ( #686 )
2016-11-12 17:20:00 -08:00
Onno Kortmann and Guido van Rossum
c4125739e5
The timeout argument to Queue.{get,put} may be None ( #682 )
...
Python 2 and 3.
2016-11-11 10:29:52 -08:00
Onno Kortmann and Guido van Rossum
2d19599b68
python2: gmtime(None), localtime(None), and ctime(None) works ( #662 )
2016-11-11 09:33:50 -08:00
Hong Minhee and Guido van Rossum
5fc1b4b948
Add missing MutableSet abstract base class ( #680 )
2016-11-10 14:10:10 -08:00
Guido van Rossum and GitHub
ec4987fa5d
Fix AwaitableGenerator inheritance; Awaitable is the return value, not the yielded value ( #679 )
2016-11-10 11:57:31 -08:00
Roy Williams and Guido van Rossum
8305d51e75
Add more specific types for requests.session.Session.mount and BaseAdapter ( #674 )
2016-11-10 11:14:30 -08:00
David Percy and Guido van Rossum
9fa6c994a3
Fix zipfile getinfo return type ( #678 )
2016-11-10 11:08:57 -08:00
nobuggy and Guido van Rossum
3f03849b70
Fix asyncio.wait for() and add exceptions ( #676 )
...
* asyncio.wait_for() should accept Awaitable[_T] same as asyncio.gather()
* {Cancelled,Timeout,InvalidState}Error types missing
2016-11-10 11:00:43 -08:00
Guido van Rossum and GitHub
bf8b5ac5fd
Relax signature of gather() ( #677 )
...
Fixes #675
2016-11-10 10:55:29 -08:00
Elazar Gershuni and Guido van Rossum
dfe4bf0a70
Fix broken sys.version_info check in importlib/abc.pyi ( #673 )
...
Fixes #672 .
2016-11-09 08:43:06 -08:00
Ruud van Asseldonk and Guido van Rossum
ca98a8ee91
Add ret_type keyword argument for croniter ( #668 )
...
The croniter __init__ method does have a ret_type keyword argument.
See also https://github.com/kiorky/croniter/blob/062fdc0/src/croniter/croniter.py#L66 .
2016-11-09 08:18:09 -08:00
Hong Minhee and Guido van Rossum
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 and Guido van Rossum
1b30761802
Small changes by @rowilla to collections.pyi and urllib/requests.pyi.
...
(Extracted from PR #530.)
2016-11-08 19:40:10 -08:00
Roy Williams and Guido van Rossum
f7f9c956ff
Add stubs for cookielib to 2.
...
(Extracted from PR #530.))
2016-11-08 19:39:27 -08:00
Guido van Rossum and GitHub
970b6d5eb0
The distutils.Extension class does take positional args, and name+sources do not have defaults ( #670 )
2016-11-07 17:50:55 -08:00
Jon Dufresne and Guido van Rossum
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
Guido van Rossum and GitHub
49a8a28c29
Use self-type for parent[s] properties too ( #667 )
...
This is possible now that python/mypy#2404 has landed.
2016-11-06 11:21:45 -08:00
TrueBrain and Guido van Rossum
341c4edc37
Args is a predefined attribute on BaseException, and always Tuple[Any, ...] ( #666 )
2016-11-05 16:33:58 -07:00
TrueBrain and Guido van Rossum
cecb64b59f
In TextIO, 'errors' is Optional ( #665 )
2016-11-05 15:02:35 -07:00
TrueBrain and Guido van Rossum
3452ff5bbd
GenericBrowser has two parameters swapped around ( #664 )
2016-11-05 11:20:14 -07:00
onnokort and Guido van Rossum
cd1ef9149b
Queue.get(...) takes optional float ( #661 )
2016-11-05 10:43:52 -07:00
Guido van Rossum and GitHub
9881a2567e
Start using selftype in 3.5 pathlib ( #658 )
2016-11-04 15:32:57 -07:00
Guido van Rossum and GitHub
b476028df7
Fix signature of run_coroutine_threadsafe() ( #657 )
2016-11-04 14:49:49 -07:00
Guido van Rossum and GitHub
53014497c4
Add Coroutine. Fix signature for Generator.throw(). ( #656 )
2016-11-04 11:46:50 -07:00
Guido van Rossum and GitHub
7f7e2d4e75
Fixes for asyncio ( #654 )
...
* Fix signature of gather(). Also fold long lines and kill _GatheringFuture.
* Add several missing exports from tasks.
2016-11-04 11:19:22 -07:00