Guido van Rossum and GitHub
5b32e79f4a
[gflags] Give DEFINE* default values Optional types ( #2279 )
...
I found some code that called DEFINE_integer() and DEFINE_float() with default set to None. Perusing the code that seems to be a totally valid usage. I am not super familiar with gflags but I believe this PR consistently changes all those default values to Optional[].
2018-06-26 13:53:39 -07:00
Guido van Rossum and Jelle Zijlstra
41e5fe4457
Message.WhichOneof returns Text, not bytes ( #2274 )
2018-06-23 15:42:13 -07:00
Guido van Rossum and GitHub
c4bf27b835
Copy __builtin__.pyi to builtins.pyi, to fix breakage caused by #2128 ( #2215 )
2018-06-11 15:10:22 -07:00
Guido van Rossum and GitHub
c5e98308c0
Copy stdlib/3.4/enum.pyi to third_party/3/enum.pyi to satisfy tests ( #2214 )
...
Fix test breakage caused by #2118 .
2018-06-11 14:28:47 -07:00
Guido van Rossum and Jelle Zijlstra
af3b015aa8
mock.patch.object() attribute arg should be Text ( #2210 )
...
It works and is needed for code using the dreaded
'from __future__ import unicode_literals'.
2018-06-09 22:36:24 -07:00
Guido van Rossum and Jelle Zijlstra
a392989a30
Add support for well_known_types to google/protobuf ( #2157 )
...
Fixes #2154
2018-05-22 21:57:07 -07:00
Guido van Rossum and GitHub
d854d7e2a0
Revert "Fix signature of generic_visit method ( #2100 )" ( #2101 )
...
This reverts commit 39576c5d41 .
I merged too soon -- tests are failing.
2018-05-07 11:21:19 -07:00
Guido van Rossum and Jelle Zijlstra
2dc7d39af5
Add 'file=...' to FieldDescriptor constructor. ( #2073 )
2018-04-20 14:51:19 -07:00
Guido van Rossum and Jelle Zijlstra
30791d4208
Give Python 2 sys.getprofile() and sys.gettrace() return types (Any). ( #1988 )
...
(In Python 3 their types are already correct.)
2018-03-26 18:37:04 -07:00
Guido van Rossum and GitHub
9d9527c94c
Get rid of BLOCKED label in favor of [WIP] subject prefix ( #1956 )
...
We (I) introduced the BLOCKED label ~2 years ago, but it never got much usage, and I remember it startled some developers (Ivan may recall...). A better convention seems to put [WIP] in the subject, so let's standardize on that and get rid of the BLOCKED label.
I already removed the BLOCKED label and edited the subject of the one issue under it.
We also don't make good use of the other labels, but they seem more useful and less controversial.
2018-03-09 10:39:30 -08:00
Guido van Rossum and GitHub
ac465ea224
Add guideline for undocumented objects. ( #1938 )
...
Also add Ivan as a typeshed core dev (since he is in the group).
2018-03-02 11:54:51 -08:00
Guido van Rossum and Jelle Zijlstra
37ec012113
Change the type of BaseException.message to Any ( #1887 )
2018-02-16 13:42:28 -08:00
Guido van Rossum and GitHub
100a071729
Make the urllib.quote/unquote functions generic ( #1891 )
...
When given unicode they will return unicode.
Also make 'safe' Text.
Fixes #1893 .
2018-02-16 13:14:05 -08:00
Guido van Rossum and GitHub
40d6faeccd
Ignore thrift imports ( #1869 )
...
Fixes #1868
2018-02-09 09:11:59 -08:00
Guido van Rossum and Jelle Zijlstra
fa98de6d57
Accept Text in distutils *Version classes ( #1854 )
2018-02-05 10:50:04 -08:00
Guido van Rossum and Jelle Zijlstra
821c765991
Several packages always auto-import certain submodules on import ( #1752 )
...
* Importing yaml implies yaml.resolver
* Importing six implies six.moves
* Importing requests implies requests.packages
2017-11-17 15:15:40 -08:00
Guido van Rossum and GitHub
77c06d411c
Remove type annotation from some Loader args ( #1695 )
...
There were two problems AFAICT:
- There are multiple Loader classes without a common base class,
so this should really be a union or a protocol.
- The argument is supposed to be a class, not an instance.
Rather than figuring out a fix (which would probably require some
nasty refactoring) I'm just going back to the old situation where
these arguments are implicitly annotated with `Any`.
See also https://github.com/python/typeshed/pull/1657#pullrequestreview-72049880
2017-10-27 09:30:16 -07:00
Guido van Rossum and Matthias Kramm
994cfb5369
Make PY2 enum more like PY3 enum, fixing bug in unique() ( #1668 )
2017-10-25 09:47:45 -07:00
Guido van Rossum and Matthias Kramm
05ffb1f912
Make initial_indent and subsequent_indent AnyStr in wrap() and fill() ( #1662 )
...
Leave them alone in TextWrap.__init__(), since I don't want to make the whole class generic.
2017-10-10 15:11:48 -07:00
Guido van Rossum and Jelle Zijlstra
6d619e013c
Add textwrap.dedent() to Py2 stubs ( #1661 )
2017-10-10 10:07:18 -07:00
Guido van Rossum and Jelle Zijlstra
76685480e0
Misc fixes found by running mypy against Dropbox internal codebase "C". ( #1575 )
2017-08-25 20:34:13 -07:00
Guido van Rossum and Matthias Kramm
9238c737de
Make HasField and ClearField use Text instead of str ( #1425 )
...
This allows one to write `x.HasField("ok")` even if the file has
`from __future__ import unicode_literals`"
2017-06-21 10:51:49 -07:00
Guido van Rossum and Matthias Kramm
350563223f
Add Optional[] for all remaining cases of x: <type> = None ( #1424 )
...
* Final round of adding Optional[] to type of arguments with default = None
* Update Travis to use --no-implicit-optionals and clarify CONTRIBUTING.md
2017-06-21 10:50:21 -07:00
Guido van Rossum and GitHub
81f77b17ec
Remove double Optional[] ( #1423 )
2017-06-21 09:54:40 -07:00
Guido van Rossum and Jelle Zijlstra
04fe184dcf
Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy ( #1421 )
...
* Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy
* Make implicit Optional explicit in arg types (2and3 part)
* Convert {stdlib,third_party}/2 to explicit Optional
2017-06-20 22:18:49 -07:00
Guido van Rossum and Matthias Kramm
30256097ea
Use explicit Optional[] on argument types with default None ( #1420 )
2017-06-20 16:20:13 -07:00
Guido van Rossum and Matthias Kramm
86070643ac
Improve csv module and float() signature ( #1418 )
...
* DictReader should not be abstract. Reformat long lines.
* Make restval optional for DictWriter.__init__.
* The arg to reader() is *Iterable*, not *Iterator*.
* Improve signature of float() (use Union instead of overload).
2017-06-20 13:04:10 -07:00
Guido van Rossum and Matthias Kramm
4fbdcf5b03
Revert "add back 'repeat' argument to itertools.product ( #1407 )" ( #1409 )
...
This reverts commit d5e7663f93 .
2017-06-14 13:10:29 -07:00
Guido van Rossum and Jelle Zijlstra
ab0de25949
Bump typed-ast version to 1.0.4 ( #1408 )
2017-06-14 10:43:28 -07:00
Guido van Rossum and Jelle Zijlstra
2216616195
Add explanation on how to use typeshed with mypy etc. ( #1284 )
2017-05-22 10:47:51 -07:00
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
Guido van Rossum and GitHub
24f5bc4a2a
Explain the set of labels we actually use ( #1226 )
2017-04-30 10:46:44 -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
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
Guido van Rossum and Jelle Zijlstra
359c8cc313
Remove all mention of 'module' from typeshed. ( #1156 )
...
This depends on python/mypy#3107 .
2017-04-13 08:40:52 -07:00
Guido van Rossum and Jelle Zijlstra
761ee6afb3
Update configs and instructions for running tests manually. ( #1137 )
...
- Switch requirements-tests-py3.txt to use mypy GitHub master.
- Exclude .venv{2,3} (suggested in README.md) in .flake8 and .gitignore.
- Update instructions in README.md to be working.
- Remove runtests.sh script and mentions of it -- I can't get it to work
and the three steps are easily run by hand.
2017-04-08 19:06:54 -07:00
Guido van Rossum and Jelle Zijlstra
f44e461d19
Use a separate type variable for unique() ( #1138 )
...
* Use a separate type variable for unique()
See https://github.com/python/typeshed/pull/1136#discussion_r109727053
* actually use the new typevar
2017-04-04 23:48:19 -07:00
Guido van Rossum and Jelle Zijlstra
7027c3e4e8
Support enum iteration ( #1136 )
...
* Support enum iteration.
Fixes python/mypy#2305 .
* Make EnumMeta inherit from type, not ABCMeta.
2017-04-04 10:17:52 -07:00
Guido van Rossum and Jelle Zijlstra
3594b0e607
Fix JSONWebSignatureSerializer.load_dangerous() signature to satisfy mypy. ( #1135 )
...
The latest mypy complained that the signature didn't match that in the
superclass: Serializer.load_payload() has a serializer argument. I
don't know this project but I think it's best to just add that
argument (rather than adding `# type: ignore`).
2017-04-04 09:51:56 -07:00
Guido van Rossum and GitHub
1ea3d2de57
Make all single-constraint TypeVars use bound= insteads (plus hack) ( #1118 )
...
Another attempt for #804 , to unblock python/mypy#2626 .
There's a work-around here for python/mypy#1551 .
2017-03-29 14:59:24 -07:00
Guido van Rossum and GitHub
6a06dd40e1
Revert "Make os.stat_result and friends NamedTuples" ( #1113 )
...
* Revert "Added missing attributes of typing.Generator and typing.AsyncGenerator (#886 )"
This reverts commit 8b26422b95 .
2017-03-29 12:03:50 -07:00
Guido van Rossum and Jelle Zijlstra
72d275bbf5
Don't reference long in types.pyi ( #1112 )
...
(It's a type alias for int anyway, and it will cause a problem in the
initial import cycle once #886 is merged.)
2017-03-29 10:43:44 -07:00
Guido van Rossum and Jelle Zijlstra
03bfcee0b8
Remove sqlalchemy. ( #1105 )
...
See discussion in https://github.com/python/typeshed/pull/1094 .
If we do this we should make it easier in mypy to install 3rd party stubs that are used by default.
2017-03-28 08:25:00 -07:00
Guido van Rossum and GitHub
671d3870c2
Add 'file' attribute to cgi.[Mini]FieldStorage ( #1104 )
2017-03-27 14:27:38 -07:00
Guido van Rossum and Jelle Zijlstra
16074c1e66
Make cgi.escape() polymorphic in Python 2 ( #1098 )
2017-03-25 13:53:36 -07:00
Guido van Rossum and GitHub
604839c3a2
Revert "Improved annotations for select.select() ( #1080 )" ( #1097 )
...
This reverts commit 7e05d47b81 .
See discussion at https://github.com/python/typeshed/pull/1080
2017-03-25 12:36:40 -07:00
Guido van Rossum and Jelle Zijlstra
fd77dd2e7a
Make type of 'env' more flexible ( #1091 )
...
See https://github.com/python/typeshed/pull/1059#issuecomment-289150121
2017-03-24 15:58:01 -07:00
Guido van Rossum and Jelle Zijlstra
de95aac022
Remind core devs to delete their branches ( #1073 )
2017-03-22 20:23:37 -07:00
Guido van Rossum and Jelle Zijlstra
af2fadc180
More fixes related to PathLike ( #1061 )
...
* Make DirEntry generic over AnyStr, and inherit from PathLike if it exists
* Make pathlib require PathLike[str] (when it exists)
2017-03-21 22:26:21 -07:00
Guido van Rossum and Jelle Zijlstra
7587e7f1c1
Make PathLike generic in AnyStr ( #1060 )
2017-03-21 14:33:22 -07:00
Guido van Rossum and GitHub
43d7747f59
Add missing List imports to dateutil package. ( #934 )
2017-02-14 11:59:19 -08:00
Guido van Rossum and GitHub
0e9ad51882
Declare asyncio.wait() as taking an Iterable rather than a List. ( #901 )
2017-01-30 13:55:39 -08:00
Guido van Rossum and GitHub
94641f5a84
Revert "Make all single-constraint TypeVars to use bounds" ( #806 )
...
Reverts python/typeshed#804 .
Reason: until python/mypy#1551 is fixed this gives an error whenever @skip() is used.
Specifically see https://github.com/python/typeshed/pull/804#issuecomment-269926655 .
2017-01-01 16:35:50 -08:00
Guido van Rossum and GitHub
b46280ec78
Make FrozenSet covariant. ( #769 )
...
Follow-up for PR #726 .
2016-12-13 11:40:18 -08:00
Guido van Rossum and Łukasz Langa
bbbf1d8c7a
PurePath.parent[s] should be properties ( #706 )
...
PurePath.parent[s] should be properties
2016-11-28 14:01:22 -08:00
Guido van Rossum and GitHub
ec4987fa5d
Fix AwaitableGenerator inheritance; Awaitable is the return value, not the yielded value ( #679 )
2016-11-10 11:57:31 -08:00
Guido van Rossum and GitHub
bf8b5ac5fd
Relax signature of gather() ( #677 )
...
Fixes #675
2016-11-10 10:55:29 -08:00
Guido van Rossum and GitHub
970b6d5eb0
The distutils.Extension class does take positional args, and name+sources do not have defaults ( #670 )
2016-11-07 17:50:55 -08:00
Guido van Rossum and GitHub
49a8a28c29
Use self-type for parent[s] properties too ( #667 )
...
This is possible now that python/mypy#2404 has landed.
2016-11-06 11:21:45 -08:00
Guido van Rossum and GitHub
9881a2567e
Start using selftype in 3.5 pathlib ( #658 )
2016-11-04 15:32:57 -07:00
Guido van Rossum and GitHub
b476028df7
Fix signature of run_coroutine_threadsafe() ( #657 )
2016-11-04 14:49:49 -07:00
Guido van Rossum and GitHub
53014497c4
Add Coroutine. Fix signature for Generator.throw(). ( #656 )
2016-11-04 11:46:50 -07:00
Guido van Rossum and GitHub
7f7e2d4e75
Fixes for asyncio ( #654 )
...
* Fix signature of gather(). Also fold long lines and kill _GatheringFuture.
* Add several missing exports from tasks.
2016-11-04 11:19:22 -07:00
Guido van Rossum and GitHub
7c20adb715
Fix memoryview stub ( #651 )
...
Fixes python/mypy#2390
2016-11-02 17:18:44 -07:00
Guido van Rossum and GitHub
cb97bb54c0
Move 2.7 to 2 ( #635 )
...
Closes #579 .
2016-10-26 16:24:49 -07:00
Guido van Rossum and GitHub
66e8d4a14f
Make fromkeys() take an Iterable instead of a sequence. ( #605 )
...
(This, too, came up in python/mypy#2254 -- thanks @rwbarton!)
2016-10-14 10:00:43 -07:00
Guido van Rossum and GitHub
26dfcb6859
Make dict.fromkeys() a classmethod (which it is). ( #604 )
...
This came up in https://github.com/python/mypy/issues/2254 .
I don't know why it was previously defined as a staticmethod, perhaps
there was an old mypy issue?
2016-10-14 09:41:26 -07:00
Guido van Rossum and GitHub
ed97067f6d
Different fix for locale/str/__builtin__ issue ( #570 )
2016-09-23 10:18:04 -07:00
Guido van Rossum and GitHub
8b0e6b886d
Fix signature for __exit__ ( #542 )
2016-09-13 11:00:01 -07:00
Guido van Rossum and Jukka Lehtosalo
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
Guido van Rossum and GitHub
de4e87f574
Changes required by mypy async-await support ( #435 )
2016-08-03 17:01:35 -07:00
Guido van Rossum and GitHub
47f2746526
Fix the definitions of BadZip{f,F}ile. ( #432 )
...
In 2.7, only BadZipfile exists. In 3.x, both exist.
2016-08-02 09:04:45 -07:00
Guido van Rossum and Matthias Kramm
6e596e9609
Fix decimal and contextlib ( #428 )
...
* Decimal does not support __round__, and its __abs__ returns Decimal.
* Fix contextmanager signature too.
2016-08-02 07:39:13 -07:00
Guido van Rossum and Matthias Kramm
781b079f91
Add Supports{Abs,Float,Int,Round} as base classes for Decimal. ( #415 )
2016-07-28 15:13:27 -07:00
Guido van Rossum and GitHub
39325bf159
Mypy now supports sys.platform and sys.version_info checks ( #410 )
2016-07-27 13:25:29 -07:00
Guido van Rossum and Matthias Kramm
6d8628c247
Misc asyncio changes ( #373 )
...
* Add stub for cgi.parse_header().
* Improve asyncio stubs (far from complete)
* More asyncio changes.
* Use @overload to solve strange test failures.
* Add some TODOs. Make ProactorEventLoop conditional.
* Future should not inherit from Awaitable or implement __await__.
At least not yet.
* Fix AbstractServer.wait_closed() return type.
It's a generator, not a future.
2016-07-15 15:44:29 -07:00
Guido van Rossum and Matthias Kramm
6aeea2a872
Add stub for cgi.parse_header(). ( #371 )
2016-07-15 15:42:51 -07:00
Guido van Rossum and Jukka Lehtosalo
f47ff0b966
Add --strict-optional flag to mypy ( #368 )
2016-07-13 17:50:36 +01:00
Guido van Rossum and Matthias Kramm
53d126f4d4
More fixes for argparse. ( #362 )
2016-07-13 07:51:29 -07:00
Guido van Rossum and David Fisher
b63e09c239
Fix some issues for dateutil and argparse ( #357 )
...
* Fix stubs for 2.7/dateutil. They were pretty broken.
(The 3/dateutil share some of the brokenness but that's still a TODO.)
* Fix argparse stubs.
- Container is not strong enough for choices.
- add_subparsers() returns something with an add_parser() method.
2016-07-12 16:24:33 -07:00
Guido van Rossum and David Fisher
1c4662d2f3
Two small changes to help the mypy test suite pass ( #355 )
...
* Condition arg for skip{If,Unless} should be object, not bool.
* Env arg to os.get_exec_path() is a Mapping, not a Dict.
2016-07-12 14:10:36 -07:00
Guido van Rossum and GitHub
8515cf5de8
Attempt to reduce cyclical dependencies between types and importlib. ( #335 )
...
- Move Loader and ModuleType into _importlib_modulespec.pyi.
- Add "import X as X" for these to types.pyi and importlib/abc.pyi.
The goal is to ensure mypy -i still works, to fix https://github.com/python/mypy/issues/1797 .
2016-07-05 10:23:24 -07:00
Guido van Rossum
b6b8554c6b
Add stub version of Type[C] ( #216 )
2016-05-24 16:44:13 -07:00
Guido van Rossum
3e37029bfe
Almost all re functions take a compiled pattern. (Even re.compile()!) ( #203 )
...
* Almost all re functions take a compiled pattern. (Even re.compile()!)
Fixes #188
Note: I'm using AnyStr so that the type of string used for pattern and
for the rest of the arguments must match. This is not 100% correct,
since Python 2 sometimes allows mixed types. But sometimes it
doesn't, depending on the values (e.g. non-ASCII bytes), and Python 3
always insists on matching, so I think this is actually a good idea.
* Same treatment for stdlib/3/re.pyi.
2016-05-16 11:25:59 -07:00
Guido van Rossum
c21d8a41d5
Fix 2.7 bisect stubs (lo/hi have defaults). ( #182 )
2016-05-04 14:46:19 -07:00
Guido van Rossum and Jukka Lehtosalo
79554d6da2
Add type.__call__. Fix #158 . ( #159 )
2016-04-25 16:22:00 +01:00
Guido van Rossum
c7cdcede71
Merge pull request #141 from bdarnell/updates
...
Various updates to stdlib modules
2016-04-10 21:40:30 -07:00
Guido van Rossum
4f483dc314
Precision surgery to take out sqlalchemy test failures ( #140 )
...
* Comment out parts of the sqlalchemy stubs to make tests pass.
* Run all tests, one step per Python version.
2016-04-10 20:45:42 -07:00
Guido van Rossum
5894f631ae
Merge pull request #134 from tharvik/master
...
add `__dict__` attribute to class instance
2016-04-04 08:38:12 -07:00
Guido van Rossum
5be96f78d8
Merge pull request #129 from isg/patch-2
...
Update dbapi2.pyi to allow `execute` without binding params
2016-03-23 13:30:57 -07:00
Guido van Rossum
7484499ce5
Merge pull request #121 from jukebox/fileinput
...
fileinput first version
2016-03-23 10:35:04 -07:00
Guido van Rossum
53e2d43f37
Merge pull request #127 from mulkieran/master-reduce
...
Fix signature for reduce in some files.
2016-03-22 08:36:07 -07:00
Guido van Rossum
3ff8635d2c
Merge pull request #124 from ddfisher/master
...
Add version keyword arg to argparse.ArgumentParser.add_argument
2016-03-18 10:04:19 -07:00
Guido van Rossum
3657e5146e
Merge pull request #123 from jstasiak/python3-fcntl
...
Improve Python 3 fcntl stub
2016-03-17 16:53:49 -07:00
Guido van Rossum
625b9c389a
Merge pull request #122 from ahaven/contextmanager-stubs
...
Better stub for contextlib.contextmanager.
2016-03-16 15:29:39 -07:00
Guido van Rossum
b7eedfa07c
Merge pull request #120 from mgeisler/pickle-py2
...
Complete pickle and cPickle stubs for Python 2
2016-03-15 12:43:58 -07:00
Guido van Rossum
6dcb32c7d9
Merge pull request #119 from mgeisler/pickle
...
Complete pickle stubs
2016-03-15 08:04:59 -07:00
Guido van Rossum
f523a8e9f1
Merge pull request #116 from mgeisler/configparser
...
Add stubs for configparser
2016-03-15 08:02:53 -07:00
Guido van Rossum
b1a5d2194f
Merge pull request #118 from mgeisler/getpass
...
Complete getpass stubs
2016-03-15 07:59:10 -07:00