Commit Graph

345 Commits

Author SHA1 Message Date
Michael Lee
f29a996501 Refine stubs for numbers.pyi (#543)
* Partially refine numbers.pyi

This commit refines numbers.pyi. More specifically, it...

- Adds in explicit type annotations where it's obvious how to do
  so (leaving more non-obvious type signatures alone).
- Adds in missing '@abstractmethod' decorators
- Combines together the Python 2 and Python 3 versions of numbers.pyi.

* Merges Python 2 and Python 3 numbers.pyi

This commit removes the old `stdlib/2.7/numbers.pyi` file and moves the
previously-committed `stdlib/3/numbers.pyi` to the shared `2and3`
directory.

* Modify comment at top of numbers.pyi

Since the stubs are no longer identical to what stubgen creates, the
comment should also probably be changed.
2016-09-14 08:12:36 -07:00
Sebastian Meßmer
96ba62503b Use concrete type in sys.excepthook() (#547)
This is necessary, because exception formatting functions like `traceback.format_exception()` expect to get `Type[BaseException]`, but sys.excepthook only provided `type`
2016-09-14 08:03:41 -07:00
Elazar
e25b882041 Full signature for namedtuple (#541) 2016-09-13 16:17:26 -07:00
Guido van Rossum
8b0e6b886d Fix signature for __exit__ (#542) 2016-09-13 11:00:01 -07:00
Sebastian Meßmer
052574d821 Add missing type hints to subprocess.pyi (#539) 2016-09-13 09:17:17 -07:00
Sebastian Meßmer
f728e413b8 Fix a missing type in stat.pyi (#536) 2016-09-12 11:13:42 -07:00
Alvaro Caceres
ecc400f125 Make string.Template.substitute's arg optional (#535) 2016-09-12 11:12:28 -07:00
Guido van Rossum
25cb6e4ab4 Make Mapping covariant. (#512)
* Make Mapping covariant.

Fixes #510.

This requires a `# type: ignore` on `__getitem__` and `get` because
mypy complains about covariant parameters.

FWIW typing.py needs to be changed too.  (It was covariant in the
value but invariant in the key -- typeshed was invariant in both.)

* Delete outdated comment.

* Backpeddle a bit -- Mapping key type should not be covariant.
2016-09-05 20:57:37 +01:00
Valérian Rousset
1d5b35b2a5 Merge tarfile (#467) 2016-09-03 08:40:45 -07:00
Danny Weinberg
708fd960da Fix errors in stubs when running in strict mode (#515) 2016-09-02 19:04:56 -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
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
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
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
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
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
Emanuel Barry
0989cb1cb3 Add FrozenSet to the typing stub files (#474) 2016-08-13 19:34:38 -07:00
Valérian Rousset
2824cd1197 Improve locale (#462) 2016-08-10 13:52:29 -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
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
cc8799ee36 Make Future a generic, like in python2 (#449) 2016-08-05 11:57:10 -07:00
David Euresti
d760d48f52 Copy string.Formatter to python 3 (#443) 2016-08-05 07:47:23 -07:00
David Euresti
a98e9aa651 Enable UF_COMPRESSED and UF_HIDDEN in stat in python3 (#444) 2016-08-05 07:24:16 -07:00
David Euresti
141318c056 Add RemoteError and current_process to multiprocessing (#445) 2016-08-05 07:19:46 -07:00
wreed4
382cb5fe20 Updating subprocess.pyi to support python 3.5 (#438)
* Updating subprocess.pyi to support python 3.5 

Also added DEVNULL which was added in 3.3

* Incorrectly checked sys.version_info

* Addressed travis build failures

Forgot that __init__ should return None and also forgot "self" on a method. Like a dummy.
2016-08-05 07:01:34 -07:00
Guido van Rossum
de4e87f574 Changes required by mypy async-await support (#435) 2016-08-03 17:01:35 -07:00
Valérian Rousset
5a5138aa1e Add stubs for pkgutils (#431)
* py3 done (py2 pass empty)

* remove dangling importlib

* importlib.abc only exists in py3
2016-08-03 15:40:37 -07:00
Daniël van Eeden
d315ceb060 Add os.scandir and os.DirEntry (#424)
Introduced in Python 3.5
2016-08-03 15:40:00 -07:00
Daniël van Eeden
51a519b358 Add timeout argument to Popen communicate (#423)
This was added in Python 3.3
2016-08-03 15:39:35 -07:00
Valérian Rousset
2e560d38dc Improve distutils (#418)
* remove old distutils

* core done

* ccompiler done

* compilers done

* archive_util done

* dep_util done

* dir_util done

* file_util done

* util done

* dist done

* debug, error, extension done

* fancy_getopt done

* filelist, log, spawn done

* sysconfig done

* text_file done

* version done

* cmd done

* add command

* add emxccompiler which is py2 only

* command.build_py have spec only in py3

* make pytype happy by resolving relative import
2016-08-03 15:38:15 -07:00