makinacorpus / django-safedelete

Mask your objects instead of deleting them from your database.
https://django-safedelete.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
677 stars 122 forks source link

add type annotation #215

Open mazlum opened 2 years ago

mazlum commented 2 years ago

Do you think adding type annotation completely?

sebastian-philipp commented 2 years ago

what do you miss exacly? Together with django-stubs, this is already super helpful as it is.

mazlum commented 2 years ago

There is no type annotation for some functions.

https://github.com/makinacorpus/django-safedelete/blob/master/safedelete/queryset.py#L98

And the latest versions of mypy and django-stubs say: "call to untyped function in typed context"

for .filter function.

Gagaro commented 2 years ago

The idea was to just add the minimum so that mypy could be used with safedelete, but I added a few typings at the same time to bootstrap it.

Feel free to open a PR to add more if you feel like it, I don't think I'll have time to do that anytime soon.