Guido van Rossum and GitHub
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 and Guido van Rossum
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 and Matthias Kramm
238c869965
merge _codecs into 2and3 ( #1228 )
...
* merge _codecs into 1and3
* handle encoding maps correctly
2017-05-01 07:51:08 -07:00
Jelle Zijlstra and Guido van Rossum
0728096541
stub for nturl2path ( #1208 )
2017-04-30 14:16:30 -07:00
Guido van Rossum and GitHub
24f5bc4a2a
Explain the set of labels we actually use ( #1226 )
2017-04-30 10:46:44 -07:00
Jelle Zijlstra and Guido van Rossum
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 and Guido van Rossum
b9e896d97c
make type aliases in lxml.etree private ( #1216 )
...
Naming the alias "AnyStr" isn't a great idea since AnyStr normally means
the typevar.
Also removed some whitespace in accordance with typeshed style.
2017-04-30 09:36:37 -07:00
Jelle Zijlstra and Guido van Rossum
7be1a6f1fd
fix some types in poplib ( #1225 )
...
Fixes a problem introduced in #1211 .
2017-04-30 08:56:42 -07:00
Jelle Zijlstra and Matthias Kramm
ee0f341ecb
stub for poplib ( #1211 )
...
* stub for poplib
* poplib: str -> Text
2017-04-27 09:51:29 -07:00
Jelle Zijlstra and Matthias Kramm
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 and Matthias Kramm
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 and Matthias Kramm
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 and Matthias Kramm
d394d8c6bf
stub for pickletools ( #1210 )
2017-04-27 08:14:21 -07:00
Jelle Zijlstra and Matthias Kramm
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 and Matthias Kramm
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 and Jelle Zijlstra
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
Jelle Zijlstra and Guido van Rossum
c05570cf00
fix example in README.md ( #1217 )
...
"int or float" isn't valid.
2017-04-26 08:15:38 -07:00
Jelle Zijlstra and Guido van Rossum
3101768f12
drop 3.2 ( #1213 )
...
Closes #1145 .
2017-04-25 17:15:49 -07:00
Teddy Sudol and Jelle Zijlstra
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 and Jelle Zijlstra
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 and Jelle Zijlstra
f71ea30cac
Created pyi for SimpleHTTPServer [Python 2.7] ( #1186 )
2017-04-25 16:17:09 -07:00
Teddy Sudol and Jelle Zijlstra
e5a0c46004
Add pyi for sets (Python2.7) ( #1176 )
2017-04-24 18:53:47 -07:00
Jelle Zijlstra and Łukasz Langa
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 and Łukasz Langa
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 and Łukasz Langa
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 and Łukasz Langa
6f5c6b5078
add some missing constants ( #1198 )
...
Closes #2
2017-04-24 15:05:02 -07:00
Jelle Zijlstra and Łukasz Langa
56bc0f5766
rewrite _operator stubs ( #1196 )
...
Fixes #835
2017-04-24 15:04:42 -07:00
Jelle Zijlstra and Łukasz Langa
4ea4bf63f8
add some missing names to abc.pyi ( #1199 )
...
Fixes #304
2017-04-24 15:04:16 -07:00
Jelle Zijlstra and Łukasz Langa
8f1875b97b
fixes to xml.sax ( #1201 )
2017-04-24 15:03:07 -07:00
Jelle Zijlstra and Łukasz Langa
e8e002d9c0
stubs for smtpd ( #1203 )
2017-04-24 15:02:51 -07:00
Jelle Zijlstra and Łukasz Langa
0fcece539b
Stubs for sched ( #1204 )
...
* stubs for sched
* can't use NamedTuple classes
2017-04-24 15:02:25 -07:00
Jelle Zijlstra and Łukasz Langa
5a20d41d4a
stubs for reprlib ( #1205 )
2017-04-24 14:57:26 -07:00
Jelle Zijlstra and Guido van Rossum
bea973ac22
stub for pty ( #1206 )
...
https://docs.python.org/3/library/pty.html
2017-04-24 13:55:33 -07:00
Jelle Zijlstra and Guido van Rossum
3e51331118
fix parent classes of mmap ( #1190 )
...
Fixes #1184
2017-04-22 15:55:23 -07:00
Jelle Zijlstra and Guido van Rossum
01ce742298
Add .mypy_cache/ to .gitignore ( #1192 )
...
Since it's now generated by mypy by default.
2017-04-22 15:54:48 -07:00
Jelle Zijlstra and Guido van Rossum
1350d7e4d2
Fixes for datetime and relativedelta ( #1191 )
...
Fixes #1163 .
2017-04-22 15:52:55 -07:00
Jelle Zijlstra and Guido van Rossum
8dc082dce5
fix arg names in string.pyi ( #1188 )
2017-04-21 17:52:48 -07:00
Jelle Zijlstra and Guido van Rossum
77af85649b
Revert "Sadly symlinks don't work on Windows. ( #1173 )" ( #1189 )
...
This reverts commit 8b835f9500 .
(Because we've fixed the issue in python/mypy#3213.)
2017-04-21 16:25:10 -07:00
David Euresti and Jelle Zijlstra
759da86478
Cleanup six.moves module ( #1180 )
...
* Cleanup six.moves
Regenerate files so all imports are present, comment out imports that fail.
Remove useless files.
* Fix flake8
2017-04-21 16:03:19 -07:00
Guido van Rossum and Jelle Zijlstra
a934d57f3b
[optparse] Change Uses of List[] to Sequence[] in argument positions. ( #1179 )
...
* Change Uses of List[] to Sequence[] in argument positions.
One of these (parse_args()) broke in real-world code, because the
expected type was List[Union[str, bytes]] but the actual type was
List[str] (because List is invariant). That is ridiculous, so I
changed the accepted type to Sequence[_Text] which is covariant. Then
I found a few other methods/functions that probably should also be
changed to Sequence, but I'm less certain of those. I'm not at all
sure about the instance/class attributes, so I left those alone
(though I suspect those might also have to switch).
* Fixes suggested by code review
- Changed Sequence[Option] to Iterable[Option] everywhere
- Changed _process_args to plain List
2017-04-21 12:22:24 -07:00
Cooper Lees and Łukasz Langa
6e1d915944
- Add support for PathLike to _PathType for Python 3.6 Unions only ( #1165 )
2017-04-21 10:13:33 -07:00
Jeremy Apthorp and Guido van Rossum
55dc338bbf
Add stub for asyncio.wrap_future ( #1183 )
...
Closes #1182 .
2017-04-21 07:53:14 -07:00
Ethan and Matthias Kramm
625ea80a99
update OptParse to work on 2and3 ( #1164 )
...
* update OptParse to work on 2and3
* remove duplicative dunder methods in Option
* Union Nones to Optional and Text->_Text
2017-04-19 06:10:07 -07:00
Sam Dunster and Jelle Zijlstra
6582a8fb59
Add collections.abc.Collection ( #1177 )
2017-04-18 21:08:06 -07:00
Eddie Antonio Santos and Matthias Kramm
244f89d8cd
Add uri param for sqlite3.connect (Python 3.4+). ( #1171 )
2017-04-18 15:09:51 -07:00
Guido van Rossum and GitHub
8b835f9500
Sadly symlinks don't work on Windows. ( #1173 )
...
So I have to make {ntpath,macpath}.pyi real copies of posixpath.pyi.
2017-04-18 11:55:02 -07:00
Guido van Rossum and GitHub
bb0a841471
Make io._IOBase and its descendents concrete. ( #1172 )
...
This solves the issue with instantiating gzip.GzipFile() mentioned at
https://github.com/python/typeshed/pull/1160#issuecomment-294534004
2017-04-18 11:13:13 -07:00
Teddy Sudol and Matthias Kramm
70f7f6cce6
Add more kwargs to distutils/core.setup() ( #1170 )
...
* Add more kwargs to distutils/core.setup()
These arguments are sourced from https://github.com/python-git/python/blob/master/Lib/distutils/core.py#L44 and https://github.com/python-git/python/blob/master/Lib/distutils/dist.py#L195
I do not claim that the list of kwargs is now complete.
* Add missing optional args values
* Remove duplicate, change "Dict" to "Mapping"
2017-04-17 15:06:36 -07:00
Teddy Sudol and Matthias Kramm
243b67f0d2
Add compresslevel kwarg to tarfile ( #1169 )
...
https://docs.python.org/2/library/tarfile.html?highlight=compresslevel
2017-04-17 15:05:46 -07:00
Teddy Sudol and Matthias Kramm
194c4c6eb0
Add stubs for *path.pyi in Python 3 stdlib ( #1167 )
2017-04-17 13:07:21 -07:00