Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support typing.ForwardRef declarations #2540

Closed
koliyo opened this issue Oct 9, 2018 · 2 comments
Closed

Support typing.ForwardRef declarations #2540

koliyo opened this issue Oct 9, 2018 · 2 comments
Labels

Comments

@koliyo
Copy link

koliyo commented Oct 9, 2018

Steps to reproduce

Current behavior

With this code

from typing import ForwardRef

Foo = ForwardRef('Foo')

class Foo:
    pass

I get

foo.py:5:0: E0102: class already defined line 3 (function-redefined)

Expected behavior

I would expect pylint to support this construction

pylint --version output

$ python3 -m pylint --version
__main__.py 2.1.1
astroid 2.0.4
Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)]
@PCManticore
Copy link
Contributor

Thanks for creating an issue! This definitely makes sense.

@NeilGirdhar
Copy link

Similarly,

from typing import Callable, Any
f: Callable[[], Any]
def f():
    pass

Gives E0102: function already defined line 2 (function-redefined)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants