Skip to content

warning Field is not callable #47

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

Closed
A-Iskakov opened this issue Mar 14, 2019 · 8 comments
Closed

warning Field is not callable #47

A-Iskakov opened this issue Mar 14, 2019 · 8 comments
Labels
wontfix This will not be worked on

Comments

@A-Iskakov
Copy link

Hello guys,
I get multiple warnings while determine field in Model class, such as EmailField, BooleanField, PositiveSmallIntegerField, PositiveIntegerField, DateTimeField, TextField, NullBooleanField, UUIDField, URLField
The warning everywhere the same:
This inspection highlights attempts to call objects which are not callable, like, for example, tuples.

@A-Iskakov A-Iskakov changed the title warning Field is callable warning Field is not callable Mar 14, 2019
@mkurnikov
Copy link
Member

I have this in PyCharm, is it present in mypy too?

@A-Iskakov
Copy link
Author

I am also having this in Pycharm only

@syastrov
Copy link
Contributor

I've also experienced this in PyCharm.

@raymondsryang
Copy link

I've also experienced this in PyCharm!

@mkurnikov
Copy link
Member

Difference between "callable" and "non-callable" fields in this case is that callable ones have their __init__ method redefined, I assume bug in PyCharm is
(if this is a contents of stub file)

_T = TypeVar('_T')

class ParentField(Generic[_T]):
    def __init__(self):
        pass

class ChildField(ParentField[_T]):
    pass

ChildField will not be callable in source code, according to pycharm.

@IMBlues
Copy link

IMBlues commented Apr 4, 2019

I've also experienced this in PyCharm.

@Rocamonde
Copy link

I am also experiencing this issue in PyCharm 2018.3.3, Python 3.7, Django 2.1

@A-Iskakov
Copy link
Author

The problem almost fixed in Pycharm 2019.1, except for django.contrib.postgres.field.JSONField

@mkurnikov mkurnikov added the wontfix This will not be worked on label Aug 24, 2019
@TonyRippy TonyRippy mentioned this issue Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Development

No branches or pull requests

6 participants