Files
typeshed/stdlib/3
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-19 22:09:35 -08:00
2016-12-20 02:28:12 -08:00
2016-12-21 01:15:26 -08:00
2016-12-19 22:09:35 -08:00
2016-12-21 01:15:26 -08:00
2016-12-21 01:06:52 -08:00
2016-12-20 02:28:12 -08:00
2016-12-20 02:28:12 -08:00
2016-12-21 01:15:26 -08:00
2016-12-19 22:09:35 -08:00
2016-12-20 02:28:12 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 23:53:19 -08:00
2016-12-19 22:09:35 -08:00
2016-12-28 11:13:57 -08:00
2016-12-19 23:53:19 -08:00
2016-04-11 00:27:58 -04:00
2016-12-19 23:53:19 -08:00
2016-12-19 22:09:35 -08:00
2016-12-20 01:17:38 -08:00
2016-12-21 01:06:52 -08:00
2016-12-21 01:15:26 -08:00
2016-12-20 01:17:38 -08:00
2016-05-04 16:54:57 -07:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-20 01:54:34 -08:00
2016-12-21 01:15:26 -08:00
2016-05-17 14:32:03 +01:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-20 00:16:44 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 23:53:19 -08:00
2016-07-05 10:18:58 -07:00
2016-12-20 00:47:51 -08:00
2016-12-19 21:52:56 -08:00
2016-12-20 00:16:44 -08:00
2016-05-03 11:48:38 -07:00
2016-08-24 06:08:46 -07:00
2016-07-26 07:43:29 -07:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-02-25 09:41:32 +00:00
2015-12-30 21:59:56 +01:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-20 02:28:12 -08:00
2016-12-20 00:47:51 -08:00
2016-12-19 23:53:19 -08:00
2016-12-19 22:09:35 -08:00
2016-12-19 22:09:35 -08:00
2016-12-28 10:24:50 -08:00
2016-12-19 22:09:35 -08:00