Files
typeshed/stdlib/2and3
nimin98 20d9fcf858 Support callable contextmanagers in contextlib (#1152)
mypy could not recognize the case when we use contextmanager as a
decorator, which has been supported since Python 3.2.

In the following code snippet,

from contextlib import contextmanager

@contextmanager
def foo(arg1):
    try:
        print(arg1)
        print('1')
        yield
    finally:
        print('2')

@foo('0')
def foo2():
    print('3')

foo2()

we get mypy error as follows,
error: ContextManager[Any] not callable

The suggested changes can fix this error and properly reflect the
updated contextmanager usage pattern.
2017-04-11 14:51:03 -07:00
..
2016-12-21 01:06:52 -08:00
2017-04-04 20:14:07 -07: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
2017-04-05 13:54:05 -07: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
2017-03-14 08:22:05 -07: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
2017-03-19 13:05:07 -07:00
2017-03-19 13:08:54 -07: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
2017-03-23 08:23:06 -07:00
2017-04-07 18:01:33 -07:00
2017-04-03 09:37:20 -07:00
2017-03-23 08:24:24 -07:00
2017-03-20 20:00:52 -07:00
2017-03-23 08:23:52 -07:00
2016-12-20 00:06:36 -08:00
2017-03-23 08:25:38 -07:00
2016-12-19 22:09:35 -08:00
2017-03-23 08:25:56 -07:00
2017-03-21 05:54:48 -07:00
2016-12-21 01:06:52 -08:00
2017-03-19 17:35:31 -07:00
2017-03-20 21:11:30 -07:00
2017-04-09 18:15:58 -07:00
2016-12-21 01:06:52 -08:00
2017-03-20 20:53:44 -07:00
2016-12-19 22:09:35 -08:00
2017-03-20 20:32:44 -07:00
2016-12-21 01:06:52 -08:00
2016-12-19 21:52:56 -08:00
2017-04-04 20:13:23 -07:00