Closed
Description
In pylint 2.6.0 (and earlier) under python 3.7, the following produces an incorrect warning for
the '-> C:' return value.
from __future__ import annotations as __annotations__
class C:
@classmethod
def create(cls) -> C: # bogus warning: Undefined variable 'C'
return cls()
There is no warning when the as
clause is not there.
This clause is required in some spaces in order to avoid having the annotations
symbol pollute the
namespace and is not supposed to affect the processing future clause.
See https://docs.python.org/3/reference/simple_stmts.html#future