Files
typeshed/stdlib/2and3
Michael Lee b46366e77d Make all single-constraint TypeVars to use bounds
According to the documentation in the typing module, TypeVars cannot
have only a single constraint. Attempting to do so will actually result
in an exception at runtime. (However, this error is currently ignored
by mypy -- see https://github.com/python/mypy/pull/2626 for a related
pending pull request).

This commit changes all instances of TypeVars using a single constraint
(e.g. `T = TypeVar('T', Foo)`) to use bounds instead (e.g.
`T = TypeVar('T', bound=Foo)`.

This seems to be the correct fix for plistlib after reading the module
docs, but it's less obvious this is correct for unittest. The unittest
module originally had `_FT = TypeVar('_FT', Callable[[Any], Any])` -- an
alternative fix would have been to do `_FT = Callable[[Any], Any]`.

Although I'm not entirely sure what it means to have a bound be a
Callable, I decided to make the assumption that the original authors
probably meant to use TypeVars instead of type aliases for a reason
(possibly to handle classes implementing `__call__`?)
2017-01-01 11:34:19 -08:00
..
2016-12-21 01:06:52 -08:00
2016-12-21 01:15:26 -08:00
2016-12-21 01:06:52 -08:00
2016-12-20 00:47:51 -08:00
2016-12-20 00:47:51 -08:00
2016-12-20 00:16:44 -08:00
2016-12-20 09:07:15 -08:00
2016-12-19 23:53:19 -08:00
2016-08-05 07:55:43 -07:00
2016-07-29 08:02:24 -07:00
2016-12-19 22:09:35 -08:00
2016-08-05 12:03:21 -07:00
2016-12-29 10:17:40 -08:00
2016-12-21 01:06:52 -08:00
2016-12-20 00:47:51 -08:00
2016-12-19 23:53:19 -08:00
2016-12-21 01:06:52 -08:00
2016-12-19 21:52:56 -08:00
2016-08-05 12:04:01 -07:00
2016-08-10 13:39:38 -07:00
2016-07-22 07:38:17 -07:00
2016-12-20 00:06:36 -08:00
2016-12-19 22:09:35 -08:00
2016-12-21 01:06:52 -08:00
2016-12-21 01:06:52 -08:00
2016-12-19 22:09:35 -08:00
2016-12-21 01:06:52 -08:00
2016-12-19 21:52:56 -08:00