Rebecca Chen and Sebastian Rittau
3fbebc78cb
Require a more recent pytype version. ( #3388 )
...
Yesterday's release contains a number of pyi parser fixes, such as
support for the syntax in #3321 .
2019-10-18 23:21:53 +02:00
Rebecca Chen and Sebastian Rittau
ffd73b3e8e
Add shlex.shlex.next in Python 2. ( #3389 )
...
shlex.shlex should match the Iterator protocol, for which it needs both
`__iter__` and `__next__` (`next` in Python 2) defined.
2019-10-18 23:13:38 +02:00
Rebecca Chen and GitHub
90aa27b54a
Fix the signature of IOBase._checkClosed(). ( #3305 )
...
* In Python 2, the optional `msg` argument was missing.
* In Python 3, the method was missing altogether.
Reference:
https://github.com/python/cpython/blob/2.7/Lib/_pyio.py#L423
https://github.com/python/cpython/blob/3.6/Lib/_pyio.py#L443
2019-10-04 14:53:48 -07:00
Rebecca Chen and Sebastian Rittau
ac35a18ad6
Make the value argument to ctypes.cbool.__init__ optional. ( #3273 )
2019-09-28 00:39:04 +02:00
Rebecca Chen and Sebastian Rittau
3f8c2169d1
Define listdir in posix and import it in os. ( #3258 )
2019-09-23 23:41:05 +02:00
Rebecca Chen and Sebastian Rittau
0602840cc2
Make the type of timeout Optional[float] everywhere in subprocess. ( #3241 )
2019-09-18 11:05:49 +02:00
Rebecca Chen and Sebastian Rittau
9488b58fb3
Copy a better definition of abstractmethod from 3/abc to 2/abc. ( #3242 )
2019-09-18 11:04:53 +02:00
Rebecca Chen and Sebastian Rittau
abc241bd35
Use Literal to improve tempfile.[Named]TemporaryFile. ( #3215 )
2019-08-31 11:25:44 +02:00
Rebecca Chen and GitHub
03b38d4d2e
Add sys.flags.utf8_mode. ( #3205 )
...
This is new in Python 3.7:
https://docs.python.org/3/library/sys.html#sys.flags
2019-08-23 12:06:21 -07:00
Rebecca Chen and Jelle Zijlstra
fab2ee0d7c
Remove unnecessary quotes around forward references. ( #3191 )
2019-08-16 20:29:32 -07:00
Rebecca Chen and Jelle Zijlstra
b873894e16
Fix a typo (self -> cls) in stdlib/2/subprocess.pyi. ( #3185 )
2019-08-14 18:14:30 -07:00
Rebecca Chen and Sebastian Rittau
6f01493edc
Move some constants from tokenize to token in Python 3.7+. ( #3175 )
2019-08-08 08:45:08 +02:00
Rebecca Chen and Jelle Zijlstra
c3b70d4224
Require the newest pytype version, with a pyi parser fix. ( #3160 )
...
For https://github.com/python/typeshed/pull/3149 .
2019-07-30 13:50:51 -07:00
Rebecca Chen and Jelle Zijlstra
c356316c6f
Use pytype.config.Options.create() for prettier code. ( #3151 )
...
This is a small cosmetic change. I want to encourage use of the
nicer-lookng pytype.config.Options.create() rather than
direct construction of the command-line args, so I'm changing
over all occurrences of the latter that I can find.
2019-07-25 19:43:33 -07:00
Rebecca Chen and GitHub
40124b5f4c
Update required pytype version to one that supports async def. ( #3112 )
2019-07-11 12:47:46 -07:00
Rebecca Chen and GitHub
5dc89fe8cf
Add undocumented methods codecs.utf_16_be_{decode,encode}. ( #3091 )
...
I found the signatures here:
https://github.com/python/cpython/blob/6a16b18224fa98f6d192aa5014affeccc0376eb3/Modules/_codecsmodule.c#L729
https://github.com/google/pytype/issues/348 was opened against
pytype about utf_16_be_encode being missing.
2019-06-26 20:29:16 -07:00
Rebecca Chen and Jelle Zijlstra
d64a26cf99
Add missing constructor to types.CodeType. ( #3040 )
...
I got the argument order from
https://github.com/python/cpython/blob/2bfc2dc214445550521074f428245b502d215eac/Objects/codeobject.c#L263
and the types from the attributes already in the stub.
2019-06-08 07:07:29 -07:00
Rebecca Chen and Jelle Zijlstra
e7184d6dfc
Add undocumented but used method LWPCookieJar.as_lwp_str. ( #3041 )
...
The method is defined here:
https://github.com/python/cpython/blob/e36ed475ea429f7cc80a4d65f80b44686a74b246/Lib/http/cookiejar.py#L1864
2019-06-08 07:06:14 -07:00
Rebecca Chen and Sebastian Rittau
f8093d63cd
Move stdlib/3/curses to stdlib/2and3/curses. ( #3025 )
...
Also add the A_ITALIC constant, which is new in 3.7.
2019-06-01 10:51:07 +02:00
Rebecca Chen and GitHub
78982de5be
Remove all pyi files that use nested classes from the pytype blacklist. ( #2993 )
...
We finally support this!
2019-05-15 14:53:13 -07:00
Rebecca Chen and GitHub
aa4a84ef3f
Always use fully qualified names to refer to nested classes. ( #2983 )
...
The main purpose of this change is to get the stubs into a
form that pytype will support with its next release. Since
these stubs already mostly use fully qualified names, this
will also increase consistency.
2019-05-12 15:10:48 -07:00
Rebecca Chen and Jelle Zijlstra
5799b8dfcf
Unblacklist more third_party stubs from pytype parsing. ( #2975 )
2019-05-08 20:18:08 -07:00
Rebecca Chen and Sebastian Rittau
4990830c8f
Make pytype happy with the third_party click stubs. ( #2966 )
...
This also makes the flask stubs that depend on click parseable.
* In pytype_test, only parse files with the .pyi extension.
(There's a README in third_party/2and3/click/.)
* Annotate with ContextManager rather than using the
contextmanager decorator. This is shorter, removes a
dependency, and gets rid of the slight weirdness of a
decorator needing to be evaluated in a stub.
* Fix non-stub things.
2019-05-07 08:50:24 +02:00
Rebecca Chen and GitHub
a6d92eca10
Adjust indentation of TODOs in third_party/2/gflags.pyi. ( #2964 )
...
Having TODOs at a different level of indentation than
the surrounding lines trips up pytype.
2019-05-06 22:05:17 -04:00
Rebecca Chen and Jelle Zijlstra
7c475a48d7
Fix typo: __builtins__ should be __builtin__. ( #2963 )
2019-05-06 22:00:02 -04:00
Rebecca Chen and Jelle Zijlstra
1379fdcdd9
Remove some files from pytype's third_party blacklist. ( #2962 )
...
Removes files that are parseable with the most recent release.
2019-05-06 21:59:12 -04:00
Rebecca Chen and Jelle Zijlstra
5081d1e132
Switch pytype_test from a whitelist to a blacklist for third_party. ( #2956 )
...
During the PyCon sprints, I'm planning to bash the pytype pyi
parser into shape so we can handle all of third_party. As a first
step, create an explicit blacklist of everything pytype chokes on.
2019-05-05 22:02:52 -04:00
Rebecca Chen and Sebastian Rittau
fd57aee5da
Make shlex.shlex convertable to a list in Python 2. ( #2927 )
...
This simply copies the relevant lines over from the Python 3 stub.
2019-04-21 09:21:00 +02:00
Rebecca Chen and Sebastian Rittau
50a661afed
Complete the stub for _thread.pyi. ( #2900 )
...
Definitions based on https://docs.python.org/3/library/_thread.html .
2019-04-09 20:02:04 +02:00
Rebecca Chen and GitHub
a651e2f3cd
Update pytype_test to remove now-unnecessary parse-only functionality. ( #2897 )
...
With today's release, pytype is able to fully load
stdlib/3/collections/__init__.pyi, so the test no longer needs the
ability to partially parse stubs using the pytd tool. Removing this
functionality allows the test code to be simplified considerably.
2019-04-03 12:47:20 -07:00
Rebecca Chen and Sebastian Rittau
9b9ff64fc5
tempfile.mkdtemp() should return a str when passed no arguments. ( #2893 )
...
Otherwise, pytype expands `AnyStr` to `Union[str, bytes]`, leading
to spurious type errors later on.
* Mark the `dir` argument to mkdtemp as AnyStr.
2019-03-29 23:11:42 +01:00
Rebecca Chen and GitHub
a1d1870779
Fix a py2 parameter type in string.Template.(safe_)substitute. ( #2888 )
...
Context: https://github.com/python/typeshed/pull/2871#issuecomment-476806895
2019-03-26 23:25:15 -07:00
Rebecca Chen and Sebastian Rittau
7c80c52a7a
Add missing class pdb.Pdb. ( #2872 )
...
Based on: https://docs.python.org/3/library/pdb.html#pdb.Pdb ,
with the one difference that the `skip` argument to the
constructor is present in 2.7 despite being listed as new in 3.1.
2019-03-16 22:14:16 +01:00
Rebecca Chen and Sebastian Rittau
e541cdd1a6
Add unicode support to py2 string.Template. ( #2871 )
2019-03-16 22:12:36 +01:00
Rebecca Chen and Sebastian Rittau
03878d732a
Add attribute queue.Queue.queue. ( #2870 )
2019-03-16 22:11:48 +01:00
Rebecca Chen and Sebastian Rittau
437d8e0ddd
Add tarfile.filemode. ( #2869 )
...
This function is defined up to Python 3.7 (albeit deprecated in Python 3).
2019-03-16 09:45:01 +01:00
Rebecca Chen and Sebastian Rittau
8c252052f9
Move pydoc from 2/ to 2and3/. ( #2873 )
2019-03-16 09:37:24 +01:00
Rebecca Chen and Sebastian Rittau
4743d2521a
Remove asyncio.tasks from the pytype blacklist. ( #2874 )
...
With version 2019.03.15, pytype is able to parse this file.
2019-03-16 09:35:30 +01:00
Rebecca Chen and GitHub
45e52de188
Speed up pytype_test by reducing subprocess calls. ( #2868 )
...
Speeds up pytype considerably by directly calling pytype.io.parse_pyi
rather than running `pytype --parse-pyi` in a subprocess.
The subprocess logic is still required to handle the one pyi file
marked `# parse only` in the pytype blacklist. Once
https://github.com/google/pytype/issues/242 is fixed, the test code
can be cleaned up considerably.
2019-03-14 19:04:40 -07:00
Rebecca Chen and Sebastian Rittau
7b6bb60fe2
Remove an unused import from stdlib/3/importlib/__init__.pyi. ( #2866 )
...
pytype has trouble resolving unused imports, since it looks at usage
to distinguish submodules from other imports.
2019-03-14 19:51:19 +01:00
Rebecca Chen and Jelle Zijlstra
3f8c08402d
Remove an unnecessary entry from the pytype blacklist. ( #2799 )
2019-02-15 17:33:29 -08:00
Rebecca Chen and Jelle Zijlstra
d275e73e1f
Remove pytype workaround in os/__init__.pyi. ( #2797 )
...
Pytype release 2019.02.13 fixed the bug that
necessitated this workaround.
2019-02-14 12:29:19 -08:00
Rebecca Chen and Jelle Zijlstra
3d8a8ec45d
Fix py3 types of inspect.FullArgSpec.var(args|kw) ( #2556 )
2018-10-25 10:45:59 -07:00
Rebecca Chen and Sebastian Rittau
ea0a0fd17e
Fix _StrType in difflib in Python 2. ( #2514 )
...
difflib functions accept unicode as well.
2018-10-12 14:39:24 +02:00
Rebecca Chen and Jelle Zijlstra
9fda6b20ec
Make the signature of optparse.OptionParser.parse_args more precise. ( #2464 )
2018-09-25 21:15:10 -07:00
Rebecca Chen and Jelle Zijlstra
cfa52c7c38
Add a stub for google.protobuf.json_format. ( #2479 )
2018-09-25 21:03:27 -07:00
Rebecca Chen and GitHub
eb09e2898b
Update pytype_test to be easier to run manually. ( #2469 )
...
* Moves the pytype installation to requirements-tests-py3.txt, now
that pytype can run under Python 3.5+.
* Changes tests/pytype_test.py to not require a --python{version}-exe
argument when it can automatically find the Python interpreter, and
cleans up a few typos and out-of-date things.
* Updates the appropriate documentation.
* Updates .travis.yml.
2018-09-21 09:38:33 -07:00
Rebecca Chen and Sebastian Rittau
b7c262523b
Fix the Python 2 signature of tempfile._TemporaryFileWrapper.write. ( #2465 )
2018-09-18 13:54:56 +02:00
Rebecca Chen and Sebastian Rittau
7dbc8748dc
Add __iter__ method to codecs.StreamReader. ( #2463 )
2018-09-18 13:46:16 +02:00
Rebecca Chen and Sebastian Rittau
9e72a7fd0c
Fix the return type of decimal.Decimal.__new__. ( #2458 )
2018-09-15 18:12:52 +02:00
Rebecca Chen and Sebastian Rittau
77e4d5d5a8
Add six.moves.urllib_request and six.moves.urllib_response. ( #2455 )
2018-09-13 22:01:56 +02:00
Rebecca Chen and Jelle Zijlstra
a08c6eae23
Add two more third_party libraries to pytype_test. ( #2437 )
2018-09-07 23:42:24 -07:00
Rebecca Chen and Jelle Zijlstra
ff821f9751
Update pytype_test and pytype_blacklist ( #2225 )
...
* Add parts of third_party/ to pytype_test.
Pytype uses six and mypy_extensions, so these pyi files should be
tested with pytype.
* Remove newly loadable pyi files from pytype_blacklist.
2018-06-15 07:53:17 -07:00