Code quality: don't assign to self #8362

Most fixes are direct, some doubts in patch are 

pretty.py  the code always has `e=self` then `self=e`, unknown reason
tensor.py changing self to tensor is a little strange for codes between line 3058-3060
interval_arithmetic.py the change may influence the readbility

All the rest cases are not suitable to fix in this issue. As they are used intentionally.

sympy/galgebra/ga.py:                        self = MV.characterize_expression(self, base)
sympy/galgebra/ga.py:            self = MVtypes[mvtype](self, base)
sympy/matrices/dense.py:        self = object.__new__(cls)
sympy/polys/rings.py:            self = self.square()


On Wed, Nov 12, 2014 at 11:54:45AM -0800, Aaron Meurer wrote:
>    In sympy/core/expr.py:
> 
>  > @@ -498,13 +498,15 @@ def is_constant(self, *wrt, **flags):
>  >          wrt = wrt or free
>  >
>  >          # simplify unless this has already been done
>  > +        # issue 8362 avoid assign to self, introduce a temp variable expr here
>  > +        expr = self
> 
>    The code would also work if you used one-letter variable names everywhere.
>    This isn't about functionality, it's about readability.

1) do you think that `expr` is better than `self` as a name?
Not too much, IMHO.  You should read the code.

2) what kind of errors will newer appear if we adopt this convention?

Next, from the description:
"All the rest cases are not suitable to fix in this issue. As they are
used intentionally."

3) what's the point to adopt "the fundamental invariant", which is
not an invarial at all?  In turn, this could introduce new kind of errors.