Commit Graph

2751 Commits

Author SHA1 Message Date
Jakub Stasiak
cd12f6e255 Add some missing "type" attributes (#200) 2016-05-14 10:18:36 -07:00
Valérian Rousset
e9efb31aa7 fix integration of io with mypy (#196) 2016-05-12 16:52:36 -07:00
Guido van Rossum
5c881a6b86 Add apply() and coerce() to 2.7 builtins. 2016-05-12 15:50:41 -07:00
Thomas Grainger
833a81d85e Add __future__.generator_stop for Python 3.5 (#195) 2016-05-12 15:39:55 -07:00
Tim Abbott
ea734c69d0 Fix subprocess stubs (#198)
* subprocess.CalledProcessError output argument is optional.

* subprocess.CalledProcessError takes stderr argument in python3.

* subprocess: Fix type for command in call() and friends.

The stubs didn't correctly support the fact that you can pass a string
as well as a sequence of strings.
2016-05-12 14:45:23 -07:00
Valérian Rousset
9fdac6e0df improve io (#194)
* added types to io, some version-specific variants
* remove _io (moved the classes to io)
* remove internal, unused xml.etree._ListDataStream
2016-05-11 10:47:24 -07:00
James Tatum
33fe6a0685 Add os.replace() 2016-05-07 13:22:16 -07:00
detlefla
e2ce50b525 enable string arguments for start, end, and span methods of Match object 2016-05-07 09:53:24 -07:00
Michael R. Crusoe
0be5a11496 A couple new definitions, some more unicode for 2.7 (#185)
* Action.__init__(); ArgumentParser.__init__() & print_help()

* pprint() & pformat()

* added unicode support to url{parse,split,join,defrag}

* add unicode support to requests.api
2016-05-06 09:14:49 -07:00
Ran Benita
eab591bb08 Change datetime.datetime.astimezone tz argument type from timezone to tzinfo (#186)
timezone inherits from tzinfo, so using tzinfo is more general (and e.g.
pytz types inherit directly from tzinfo).

This is the correct type, as quoted from astimezone's code:

    elif not isinstance(tz, tzinfo):
        raise TypeError("tz argument must be an instance of tzinfo")
2016-05-06 08:06:22 -07:00
Valérian Rousset
c2194c9761 add AST.__init__ annotation (#184) 2016-05-05 11:32:06 +01:00
Jukka Lehtosalo
292447bd62 Misc stub fixes (#181) 2016-05-04 16:54:57 -07:00
Guido van Rossum
c21d8a41d5 Fix 2.7 bisect stubs (lo/hi have defaults). (#182) 2016-05-04 14:46:19 -07:00
David Fisher
e8f626536e Add Python 3 ast module; update Python 2.7 ast module; fixup typed_ast (#170) 2016-05-04 10:40:36 -07:00
Dakkaron
8dff6e481e Added bisect.pyi and ConfigParser.pyi (#171)
* stdlib/2.7./codecs.pyi: added missing __enter__() and __exit__()
* stdlib/2.7/bisect.pyi
* /stdlib/2.7/ConfigParser.pyi
2016-05-04 10:39:52 -07:00
Jakub Stasiak
f5bfee6f35 Finish Python 3 hashlib stub (#179) 2016-05-04 08:29:16 -07:00
FichteFoll
d492c5360d pprint stream type (#178)
* Use less strict IO[str] instead of TextIO

* IO[Any] should be IO[str]

See also discussion in #17.
2016-05-03 11:48:38 -07:00
FichteFoll
6537649fda json.dump{s,}' indent parameter also supports str (#175) 2016-05-01 17:50:03 -07:00
James Tatum
dfd4365b45 Add abc.ABCMeta.register method (#176) 2016-05-01 17:48:23 -07:00
rwbarton
2b80cdf75e Use overloading rather than Union for MutableMapping.update (#174)
See https://github.com/python/mypy/issues/1430 for motivation.
2016-05-01 17:50:01 +01:00
Jukka Lehtosalo
a5d5dcc4f4 Fixes to os.environ (#172)
Add os.environ.copy() to Python 2 stubs. Fix return
type of os.environ.copy().
2016-04-28 11:53:51 +01:00
Dakkaron
fde085bbdd stdlib/2.7./codecs.pyi: added missing __enter__() and __exit__() (#167) 2016-04-27 10:23:42 -07:00
Michael Lee
ce59cd4056 Add missing 3.3+ and 3.5+ math functions (#164)
Python 3.3 added the `math.log2` function; Python 3.5 added
`math.gcd`, `math.inf`, `math.isclose`, and `math.nan`.
2016-04-25 21:40:40 -07:00
Guido van Rossum
79554d6da2 Add type.__call__. Fix #158. (#159) 2016-04-25 16:22:00 +01:00
Linjie Ding
0f67b2a675 Fix Py2 hashlib.new arg type (#157) 2016-04-22 15:35:47 -07:00
Jukka Lehtosalo
8df19841bb Make Queue generic in Python 2, similar to Python 3 (#155) 2016-04-22 15:49:02 +01:00
Jukka Lehtosalo
5eaf522cde Fixes to urllib2 stubs (#154) 2016-04-22 13:19:37 +01:00
David Fisher
a8ef40467d Fix type error in 2.7 stubs (#152) 2016-04-20 14:07:30 -07:00
Michael R. Crusoe
2f59de4713 Change logging signatures to allow unicode (#150) 2016-04-18 09:41:38 -07:00
Ben Darnell
088fd393b8 Add stdlib/3/tokenize.pyi (#151)
Mostly stubgen, with open() added by hand because stubgen somehow
doesn't see it.
2016-04-17 19:59:47 -07:00
Ben Darnell
2ddbf901c9 2.7 stub updates (#149)
* Stubgen modules for 2.7

Cookie
email._parseaddr
email.utils
genericpath
linecache
mimetypes
multiprocessing
multiprocessing.process
multiprocessing.util
posixpath
quopri
runpy
weakref
wsgiref.validate

* 2.7/typing.py: add missing __contains__ definition

* 2.7/subprocess.py: make output argument to CalledProcessError optional

Commit f08160bd did the same for py3.

* 2.7/hmac.pyi: add compare_digest

This function was introduced to the 2.7 series in 2.7.7.

* Stubgen 2.7/ssl.pyi

This replaces a nearly-empty handwritten stub.

* Copy constants and other definitions from py3 to py2 ssl.pyi

* 2.7/__future__.pyi: add methods

* 2.7/_weakref.pyi: backport some definitions from 3.x version

* Stubgen 2.7/locale.pyi

Hand-edited to remove declarations that are redundant (and cause
conflicts with) the "from _locale import *" line.
2016-04-17 19:02:55 -07:00
Jukka Lehtosalo
fcef262a9b Support keyword arguments for dict() (Python 2) (#148) 2016-04-17 13:07:54 +01:00
Guido van Rossum
78e6e9b740 Add Text to typing.pyi; it's an alias for unicode in 2.7, for str in 3. 2016-04-16 13:42:17 -07:00
Jukka Lehtosalo
70c2274e94 Update dict(...) to accept keyword arguments (#147)
We can't describe the fact that a keyword argument results in a 'str'
dictionary key in a stub. This needs to be handled elsewhere.
2016-04-16 16:30:15 +01:00
Guido van Rossum
23ec1ff96a Break cycle between typing and collections. (Requires a fix in mypy.) 2016-04-15 21:31:49 -07:00
Matthias Kramm
9ff4bc1f60 Merge pull request #142 from smarkets/bz2-stub
Add a very basic bz2 stub
2016-04-13 07:51:20 -05:00
Jakub Stasiak
7535d41471 Add a very basic bz2 stub 2016-04-13 11:44:43 +02:00
David Fisher
761cbf3f59 Fix syntax error (#144) 2016-04-12 16:09:07 -07:00
Yasushi Saito
7389610937 Added type declaration for multiprocessing.pool.ThreadPool and AsyncResult. (#143) 2016-04-12 14:42:15 -07:00
Pas
68306484ae py3: traceback.pyi: added format_stack (#125) 2016-04-10 21:42:49 -07:00
Ben Darnell
54e4f51e25 Stubgen _operator.
This is needed by hmac. Stubgen has a parse failure on the operator
module (without the underscore prefix).
2016-04-11 00:27:58 -04:00
Ben Darnell
21d082a4bc Stubgen curses (and _curses)
Manual tweak to remove reference to curses.has_key (which is a fallback
for when the C module doesn't have it)
2016-04-11 00:27:58 -04:00
Ben Darnell
9fa161fe51 Stubgen gzip (and _compression) 2016-04-11 00:27:58 -04:00
Ben Darnell
e2dde66eb1 Stubgen assorted stdlib modules 2016-04-11 00:27:58 -04:00
Ben Darnell
57e25550bc concurrent.futures: stubgen
Imports had to be fixed up manually.
2016-04-11 00:27:58 -04:00
Ben Darnell
a3498d9883 weakref: add WeakKeyDictionary 2016-04-11 00:27:58 -04:00
Ben Darnell
9d2f90d2dc collections: convert from module to package
Making room for collections.abc
2016-04-11 00:27:58 -04:00
Ben Darnell
f489c54501 traceback: make first argument to format_exc optional 2016-04-11 00:27:58 -04:00
Ben Darnell
f08160bd4c subprocess: make output argument to CalledProcessError optional 2016-04-11 00:27:58 -04:00
Ben Darnell
0248a5cbcf Add methods to __future__._Feature 2016-04-11 00:27:58 -04:00