What to do with unused variables in Django (I speak mostly about class based views)?
def post(self, request, *args, **kwargs):
# request, args, kwargs are not used in this post method
..
return ..
Is it safe to del
them ?
In here I also see, that *_ can be used for things I don't care.
Why? For the sake of cleaning the code and avoiding IDE warnings.
I can safely del
*args
and **kwargs
, but how about request
? request
I can acces it later using self.request
, when using a class based view - actually I do that, but can I be sure that I will have no problem?
I see here that django request is immutable, but no in all cases.
My question is, what do do with them?