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

File.size: Unsupported operand types for "Callable" and "int". #154

Closed
wlisesrivas opened this issue Sep 5, 2019 · 4 comments
Closed

File.size: Unsupported operand types for "Callable" and "int". #154

wlisesrivas opened this issue Sep 5, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@wlisesrivas
Copy link
Contributor

wlisesrivas commented Sep 5, 2019

Django File.size is a property type:
@cached_property def size(self): ...
https://github.com/django/django/blob/master/django/core/files/base.py#L32

But in stubs it's treated like callable function (which is wrong):
def size(self) -> int: ...
https://github.com/typeddjango/django-stubs/blob/master/django-stubs/core/files/base.pyi#L17

@sobolevn
Copy link
Member

sobolevn commented Sep 5, 2019

@wlisesrivas can you please change def size(self) -> int: ... to be @property?

@sobolevn sobolevn added the bug Something isn't working label Sep 5, 2019
@wlisesrivas
Copy link
Contributor Author

@sobolevn you mean create a pull-request fixing that? If so, sure.

@sobolevn
Copy link
Member

sobolevn commented Sep 5, 2019

Yes 🙂

@sobolevn
Copy link
Member

sobolevn commented Sep 6, 2019

Closed by #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants