Commit Graph

780 Commits

Author SHA1 Message Date
Matthias Kramm
044d11f9ee clean up unittest.py (#509)
* clean up unittest.py

Remove duplicates, adjust wrapping.

* also remove unittest from pytype blacklist
2016-08-31 07:27:53 -07:00
Matthias Kramm
c46993aa8e Add mypy blacklist, same syntax as pytype blacklist. (#508) 2016-08-29 14:23:39 -07:00
Elazar
59585bbf54 Update signature of ConfigParser.get() (#501)
Fix #492

Also add RawConfigParser
2016-08-29 12:44:30 -07:00
claws
bed8a60990 add hex to bytes, bytearray, memoryview (#507) 2016-08-29 09:39:35 -07:00
johnthagen
c0da198565 Add str into Union type for "ASCII to" functions which accept str. (#505)
Fixes #503
2016-08-28 13:48:24 -07:00
Michael Lee
97bc450acd Make typing.IO inherit Iterator, not Iterable (#502)
In Python, it's possible to use the `next` builtin method on file
objects produced by `open`. This change modifies `typing.IO` so this
usage will successfully typecheck.
2016-08-27 23:31:16 -07:00
David Euresti
5e5b3726f2 Add missing Optional to str.split and socket.socket. (#504)
* Add Optional to str.split and friends

* Python 3: Make fileno arg of socket.socket Optional
Python 2: Remove fileno arg of socket.socket
2016-08-27 19:09:55 -07:00
Matthias Kramm
828f42e350 Fix syntax in README.md. 2016-08-26 13:35:47 -07:00
Elazar
f1047ec005 Stub: asyncore.pyi (#498)
* Stub: asyncore.pyi

I can't really test this stub since I don't use this module. I believe it's not far from the real thing.

It's based on the source code and not on the documentation.

https://hg.python.org/cpython/file/default/Lib/asyncore.py

* Option ->Optional

* add hint to count, remove addr

* make read/write explicit functions

* add synchat.pyi, move to 2and3

* change sys.version_info test

* try reversing the syntax
2016-08-26 13:34:42 -07:00
Danny Weinberg
68f8a278fe Improve correctness of pathlib stubs (#483)
I went through each method in the source and verified the inputs it accepts and outputs it gives. I also redefined a few methods on the `Path` class so that MyPy knows they return `Path` instead of `PurePath`. This is really just a temporary workaround until https://github.com/python/mypy/issues/1212 is fixed, but greatly improves the process of working with the `pathlib` module and is therefore likely worth the duplication.
2016-08-26 13:17:22 -07:00
David Fisher
e8df136ce8 Fix incorrectly Optional builtin function args (#500)
Many builtin functions were accidentally marked as Optional because
they were given default values of None.
2016-08-25 19:07:00 -07:00
Daniel F Moisset
0ffe3abf70 Adde JSON encoder and decoder objects (#499) 2016-08-25 08:33:39 -07:00
Guido van Rossum
73bdb705bf Delete ctypes. It is not yet ready for prime time, alas.
See https://github.com/python/typeshed/issues/475
2016-08-24 10:56:23 -07:00
peterdotran
ce940efc01 email.utils.parsedate and email.utils.parsedate_tz corrected to be passable to time.mktime (#497)
Also email.utils.parsedate_tz 10th element can be None if no timezone is specified
2016-08-24 06:10:56 -07:00
Elazar
e4b56b1be8 Stub for pyclbr.py (#487)
* Stub for pyclbr.pyi

* Quote opaque type with ""
2016-08-24 06:08:46 -07:00
Valérian Rousset
9f1e90b33f Merge bisect (#468)
* merge bisect

* comment while mypy#2035
2016-08-24 06:07:40 -07:00
Daniel F Moisset
fac745c90b Allow replace(tz_info=None) on time/datetime (#485)
* Allow replace(tz_info=None) on time/datetime

* Remove bool option for replace(tzinfo=...)
2016-08-24 06:05:21 -07:00
Tomasz Elendt
34175b888d Fix __setitem__(slice, ...) of various mutable sequences (#496)
Adds support of assigning iterables to slice of mutable sequences and
bytes to bytearray's slice.
2016-08-23 19:02:50 -07:00
Michael Lee
c10198db11 Add the selectors module (#484)
* Correct some type errors

* Use Any instead of Optional[Any]
2016-08-23 18:57:46 -07:00
David Euresti
ed7c0779f7 Add memoryview class for python 2.7 (#493) 2016-08-23 18:48:10 -07:00
peterdotran
aef68f323f Added attributes for URLError and HTTPError (#494) 2016-08-23 17:55:51 -07:00
Antoine Catton
5b5135878b Typo: isis -> is (#495)
Fixes inspect.isgeneratorfunction().
2016-08-23 16:24:16 -07:00
Tomasz Elendt
9451fa922c Add start and stop arguments to Sequence.index in Py >= 3.5 (#489)
Fixes #486.
2016-08-22 14:53:48 -07:00
David Euresti
ff86b1bd26 Remove empty wintypes module which just causes imports to break (#490) 2016-08-22 08:48:33 -07:00
Daniel F Moisset
3c76029c57 Added attributes for UnicodeEncodeError (#481) 2016-08-18 05:57:16 -07:00
Elazar
3d32e2e661 Remove namedtuple workaround (#479)
This is a dependency for PR #1076.
2016-08-17 11:54:13 -07:00
Nicholas Bishop
a20d5c481a Add type stub for typing.get_type_hints (#480)
Fixes issue #477
2016-08-16 20:41:01 -07:00
kosaka
5a79ba1abb Fixes tzinfo return types (#476) 2016-08-16 08:07:00 -07:00
Tom Manderson
9fd0fd97c6 Make FileType valid for ArgumentParser 'type' arg (#473) 2016-08-15 11:42:48 -07:00
Tyler O'Meara
1bb090d6f8 Adds logging PlaceHolder class and Logger attributes (#472)
Adds several attributes which were missing from the Logger types,
including "name", "level", and "parent". Because the type of "parent"
is a union of Logger and PlaceHolder, we also define types for
PlaceHolder and all of it's methods.
2016-08-15 11:42:02 -07:00
tonygrue-dbx
219c57a28c Add winerror to WindowsError in builtins.pyi for Python 2.7 and 3 (#470)
Adds the int type member to WindowsError stub
2016-08-15 11:41:05 -07:00
David Euresti
69fdea09c9 Fix some type errors in gettext in python2. (#469)
Also makes it look more like the python3 version
2016-08-15 11:40:16 -07:00
Valérian Rousset
17f7d3db20 Add ctypes (#454)
* util done

* __init__, 16.16.2.2 done

* 16.16.2.3 done

* 16.16.2.4

* fix *FUNCTYPE, fix generic

* remove part of generic

* temporarly broad some type

* 16.16.2.5

* 16.16.2.6

* 16.16.2.7

* 16.16.2.8

* 16.16.2.9 and cleanup

* no documentation on wintypes

* move from _SimpleCData to _CData

* base on some example

* py2 done, cleanup

* make pytype happy
2016-08-15 11:39:23 -07:00
Emanuel Barry
0989cb1cb3 Add FrozenSet to the typing stub files (#474) 2016-08-13 19:34:38 -07:00
Michael Lee
313b584e34 Add stubs for ujson (#460) 2016-08-11 17:08:03 -07:00
Valérian Rousset
2824cd1197 Improve locale (#462) 2016-08-10 13:52:29 -07:00
Valérian Rousset
59d06de83e add rlcompleter (#455) 2016-08-10 13:39:38 -07:00
Valérian Rousset
04d799f656 fix unprecise type in sys.exc_info in py2 (#466) 2016-08-10 13:37:01 -07:00
Jakub Stasiak
0edb87fc6b Make functools.cmp_to_key more realistic (#458)
The documentation[1] says:

    A comparison function is any callable that accept two arguments,
    compares them, and returns a negative number for less-than, zero for
    equality, or a positive number for greater-than.

This doesn't seem possible with the comparison function defined as
returning bool.

[1] https://docs.python.org/3.6/library/functools.html#functools.cmp_to_key
2016-08-10 12:12:52 -07:00
Valérian Rousset
ebdf9d68b2 add termios (#456) 2016-08-10 12:09:54 -07:00
Jakub Stasiak
f3818cabbc Handle passing a tuple of types to issubclass() (#459)
It can't be just any sequence hence Tuple is used instead of previously
mentioned Sequence.
2016-08-10 12:09:16 -07:00
Michael Lee
8fd2aca9a4 Fix stubs for glob to include Python 3.4+ changes (#461) 2016-08-10 12:06:00 -07:00
Valérian Rousset
4e55f0561f Improve traceback (#465) 2016-08-10 11:18:35 -07:00
Valérian Rousset
231ebbefaa add types to multiprocessing.process (#463) 2016-08-10 11:01:54 -07:00
David Fisher
f209136b3c Make appropriate Popen constructor args Optional (#457) 2016-08-08 20:14:13 -07:00
Guido van Rossum
cc1f92103d Minor cleanup of subprocess.pyi 2016-08-05 17:32:17 -07:00
jdelic
1ac3c2f173 update subprocess module stub for Python 3.5 (#426) 2016-08-05 17:31:10 -07:00
David Euresti
5de7bfe185 Add missing classes to distutils.version (#450) 2016-08-05 14:50:14 -07:00
Fu Yong Quah
6c1a185e49 Add exception globals in 2.7/sys.pyi. (#440) 2016-08-05 12:04:57 -07:00
Valérian Rousset
e3a1ddfbeb add readline module (#448) 2016-08-05 12:04:01 -07:00