Here is the code which hits false positive. Code runs fine, but hits pylint error for obj not being a contextmanager.
def contextmanagerdecorator(cls):
class DecoClass(cls):
def __enter__(self):
pass
def __exit__(self, *n, **kw):
pass
return DecoClass
@contextmanagerdecorator
class RegularClass(object):
pass
obj = RegularClass()
with obj:
pass
Here is the code which hits false positive. Code runs fine, but hits pylint error for obj not being a contextmanager.