Commit Graph

1059 Commits

Author SHA1 Message Date
Yusuke Miyazaki
c19e266dcf Fix StringIO stub for Python 3 (#1275) 2017-05-19 17:02:57 -07:00
Ryan Jarvis
4ab29832a2 Extend typing to CursesWindow object (#1271)
* Extend typing to CursesWindow object

* Correct delch() signature
2017-05-17 16:07:08 -07:00
George Caley
eac0562088 Fix return types in compileall.pyi (#1273)
* add non-None return types for compileall

* fx -> rx
2017-05-17 16:05:50 -07:00
Max
df9df65882 More precise signatures in concurrent.futures (#1262)
* Allow None in concurrent.futures.exception() and set_exception()

* Make Executor.map() signature more precise

* Remove superfluous signatures

* Specify str type for some concurrent.futures constants

* Update concurrent.futures backport

* CR fixes
2017-05-14 13:55:27 -07:00
Sergey Passichenko
6207eb8cde Add args attribute to subprocess.Popen (#1267) 2017-05-14 13:41:38 -07:00
Max
c2e6a6f670 Add queue.Queue.empty() stub (#1259)
Fixes #1242. Seems like one method was omitted by accident.
2017-05-10 18:39:56 -07:00
Mahmoud Afaneh
30283aa670 Adds Event stub to multiprocessing (#1247)
* Adds Event type to multiprocessing

* Add event and context stub to multiprocessing stub.  Updates per recommendations.

* Adding missing newline at EOF.

* Stubbing just BaseContext and not any of the member functions.

* Fix flake8 extra line.

* Fix comment.

* Add todo for BaseContext, make ctx of Any type, and remove multiprocessing.context
2017-05-10 07:20:19 -07:00
Jelle Zijlstra
8d1114c0c3 allow string levels in logging (#1234)
* allow string levels in logging

* remove redundant Union member
2017-05-10 07:09:08 -07:00
Matthias Kramm
8d8a34cb83 Patch from @sfreilich: make itertools.ifilter predicate parameter Optional (#1257)
From Samuel Freilich:
In Python 2, the predicate parameter in itertools.ifilter and
itertools.ifilterfalse can be None, indicating that true or false values
should be retained (functionally equivalent to passing "bool" as the
predicate). In Python 3, filter and itertools.filterfalse have
the same behavior.
2017-05-09 17:50:11 -07:00
Yusuke Miyazaki
d7dd9fb832 Update stub for ipaddress (#1251) 2017-05-08 16:28:04 -07:00
Sebastian Meßmer
2ed9ee104f Fix type stubs in transports.pyi (#1255) 2017-05-08 16:26:01 -07:00
Sebastian Meßmer
595e601882 Fix type stubs in events.pyi (#1256) 2017-05-08 16:24:25 -07:00
Sebastian Meßmer
9311e980f4 Fix type stubs in subprocess.pyi (#1253) 2017-05-08 16:24:02 -07:00
Jelle Zijlstra
7dd2f80194 Fixes to ContextManager (#1249)
* add typing.ContextManager for 3.6+ only

This fixes the easier part of #655.

Would it make sense to add a generic typing.ContextManager that exists in any Python version?

* update comment

* fix argument types for ContextManager.__exit__

* add AsyncContextManager

* add @asynccontextmanager

* typing.ContextManager now always exists

* back out async-related changes

Will submit those in a separate PR later

* fix import order

* AbstractContextManager only exists in 3.6+

* AbstractContextManager -> ContextManager
2017-05-08 16:21:51 -07:00
Joe Bateson
385b9c8b66 Fix optparse OptionGroup __init__ to allow missing description (#1248) 2017-05-06 12:39:55 -07:00
Matthew Page
0e21ac9892 Add stub for string.casefold
Exists in 3.3+
2017-05-05 11:11:25 -07:00
David Euresti
ac4cb7a619 Make sys.getfilesystemencoding not return None (#1245)
Fixes #1221
2017-05-05 07:45:10 -07:00
Nathan Henrie
b8a3f9359f Update pbkdf2_hmac argument names for 3.4+ (#1241)
* Update pbkdf2_hmac for Python 3.5

- Use `iterations` instead of `rounds` if running on 3.5
- Change `dklen` to `Optional`

* Use `iterations` instead of `rounds` in 3.4+
2017-05-04 21:09:07 -07:00
Semyon Proshev
a2561cc4b2 Update typing.NamedTuple.__init__ to support fields passed through kwargs (#1239)
* Update `typing.NamedTuple.__init__` to support fields passed through kwargs

* `Verbose` and `rename` were returned to `typing.NamedTuple.__init__`
2017-05-04 08:26:15 -07:00
Manuel Krebber
2d96eecd30 Itertools update (#1233)
* Updated the typehints for itertools.

* Removed the overload because it caused problems and cleaned up the imports.

* Update itertools.pyi

Added back optionality of second argument for itertools.permutations.

* Update itertools.pyi

Moved the Optional which I accidentially put on the wrong function -.-
2017-05-03 08:53:48 -07:00
Guido van Rossum
b6a9a05743 Turn uidl() into an overload. (#1231)
The previous change was still right. Unique among `poplib` functions, `uidl()` returns a long response when called without arguments, but just a bytes string when called with a `which` argument.
2017-05-01 08:56:27 -07:00
Jelle Zijlstra
464761bfd3 Fixes to shutil stub in Python 3 (#1227)
Mostly PathLike support; also added the os.terminal_size namedtuple.
2017-05-01 08:30:41 -07:00
Jelle Zijlstra
238c869965 merge _codecs into 2and3 (#1228)
* merge _codecs into 1and3

* handle encoding maps correctly
2017-05-01 07:51:08 -07:00
Jelle Zijlstra
0728096541 stub for nturl2path (#1208) 2017-04-30 14:16:30 -07:00
Jelle Zijlstra
b084bcd037 review exported names in collections stubs (#1197)
Fixes #709

I looked at dir(collections) in 2.7 and 3.6 and made sure the list of names matched the stubs.
2017-04-30 09:59:37 -07:00
Jelle Zijlstra
7be1a6f1fd fix some types in poplib (#1225)
Fixes a problem introduced in #1211.
2017-04-30 08:56:42 -07:00
Jelle Zijlstra
ee0f341ecb stub for poplib (#1211)
* stub for poplib

* poplib: str -> Text
2017-04-27 09:51:29 -07:00
Jelle Zijlstra
9cd8bba40f stub for nntplib (#1209)
Put this in stdlib/3 because it changed pretty radically in 3.2. We might be
able to move it to 2and3 later, but I want to focus on completing the Python 3
standard library first.
2017-04-27 08:48:22 -07:00
Jelle Zijlstra
1d6e3f492e Fix incorrect usage of AnyStr (#1215)
* Fix incorrect usage of AnyStr

- sqlite3 was using Union[bytes, AnyStr], which doesn't make sense
- The urllib functions I changed accept either bytes or str for their "safe"
  argument
- Also added supports for PathLike to pstats
- Remove some unused imports of AnyStr

* pstats: python 2 accepts unicode
2017-04-27 08:47:59 -07:00
Jelle Zijlstra
dad65e4121 improve stubs for _codecs (#1219)
* improve stubs for _codecs

I noticed that many of these used AnyStr in a context where it doesn't make
sense. Found a few more things after reviewing _codecsmodule.c:
- Some Windows-only functions were omitted
- A few argument counts and names and return types were wrong

The Python 2 _codecs stub has many of the same issues, but the module is also
pretty similar between Python 2 and 3. I'm planning to send another PR after this
one to merge the two and move the stub into 2and3.

* correct platform name
2017-04-27 08:47:42 -07:00
Jelle Zijlstra
d394d8c6bf stub for pickletools (#1210) 2017-04-27 08:14:21 -07:00
Jelle Zijlstra
c1a736fd6d fixes to fileinput (#1218)
- Correct incorrect return type for hook_encoded
- Add PathLike support
- Add some missing types
- Remove incorrect use of AnyStr
2017-04-27 08:12:53 -07:00
Jelle Zijlstra
d1da44dc1b add bytes.__mod__ (#1212)
Fixes python/mypy#3247

Also reviewed some related logic:
- __mod__ was added to both bytes and bytearray with PEP 461, which went into 3.5
- str.__mod__ takes only one argument, and the signature calls it "value"
- In Python 2, bytearray doesn't have __mod__ (and typeshed correctly omits it)
2017-04-27 08:07:59 -07:00
Ivan Levkivskyi
c133a3aca7 First argument to traceback.extract_tb can be None (#1223)
* First argument to traceback.extract_tb can be None

* Add Optional also to print_tb, format_tb, and walk_tb
2017-04-27 08:07:40 -07:00
Teddy Sudol
4e22318980 Add pyi for pydoc [Python 2.7] (#1187)
* Add pyi for pydoc [Python 2.7]

* Fixed issues

* A few more fixes

- `synopsis -> Optional[AnyStr]`
- `visiblename` takes a `Container`
- `getdoc -> Union...` not `AnyStr`

* `synopsis` and `source_synopsis`
2017-04-25 16:34:45 -07:00
Teddy Sudol
31f3066124 Created stubs for xmlrpclib [Python 2.7] (#1185)
* Created stubs for xmlrpclib

* Fixed issues with xmlrpclib

* Change `_Unmarshaller` from TypeVar to alias
2017-04-25 16:22:05 -07:00
Teddy Sudol
f71ea30cac Created pyi for SimpleHTTPServer [Python 2.7] (#1186) 2017-04-25 16:17:09 -07:00
Teddy Sudol
e5a0c46004 Add pyi for sets (Python2.7) (#1176) 2017-04-24 18:53:47 -07:00
Jelle Zijlstra
397f998368 Make json into a package to match the implementation (#1194)
This is the other half of fixing #1115.

Also fixed the stub for JSONDecodeError and made it only exist in 3.5+.

Didn't otherwise review the exact attributes and types in the package.
2017-04-24 15:32:05 -07:00
Jelle Zijlstra
5f2f96340f complete stubs for imp (#1193)
* complete stubs for imp

Helps fix #1115

* fix import
2017-04-24 15:31:29 -07:00
Jelle Zijlstra
e3f495b7e9 Add missing enum attributes (#1195)
Fixes #854 (unless there's more I'm missing).
2017-04-24 15:30:59 -07:00
Jelle Zijlstra
6f5c6b5078 add some missing constants (#1198)
Closes #2
2017-04-24 15:05:02 -07:00
Jelle Zijlstra
56bc0f5766 rewrite _operator stubs (#1196)
Fixes #835
2017-04-24 15:04:42 -07:00
Jelle Zijlstra
4ea4bf63f8 add some missing names to abc.pyi (#1199)
Fixes #304
2017-04-24 15:04:16 -07:00
Jelle Zijlstra
8f1875b97b fixes to xml.sax (#1201) 2017-04-24 15:03:07 -07:00
Jelle Zijlstra
e8e002d9c0 stubs for smtpd (#1203) 2017-04-24 15:02:51 -07:00
Jelle Zijlstra
0fcece539b Stubs for sched (#1204)
* stubs for sched

* can't use NamedTuple classes
2017-04-24 15:02:25 -07:00
Jelle Zijlstra
5a20d41d4a stubs for reprlib (#1205) 2017-04-24 14:57:26 -07:00
Jelle Zijlstra
bea973ac22 stub for pty (#1206)
https://docs.python.org/3/library/pty.html
2017-04-24 13:55:33 -07:00
Jelle Zijlstra
3e51331118 fix parent classes of mmap (#1190)
Fixes #1184
2017-04-22 15:55:23 -07:00