Guest User

Untitled

a guest
Jan 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. diff --git a/sympy/core/expr.py b/sympy/core/expr.py
  2. index 88713b6..44eda0c 100644
  3. --- a/sympy/core/expr.py
  4. +++ b/sympy/core/expr.py
  5. @@ -1825,7 +1825,7 @@ def as_coeff_exponent(self, x):
  6. """ c*x**e -> c,e where x can be any symbolic expression.
  7. """
  8. x = sympify(x)
  9. - wc = Wild('wc')
  10. + wc = Wild('wc', exclude=[x])
  11. we = Wild('we')
  12. p = wc*x**we
  13. from sympy import collect
  14. diff --git a/sympy/core/mul.py b/sympy/core/mul.py
  15. index d544ca4..ef27545 100644
  16. --- a/sympy/core/mul.py
  17. +++ b/sympy/core/mul.py
  18. @@ -3,7 +3,8 @@
  19. from operations import AssocOp
  20. from cache import cacheit
  21. from logic import fuzzy_not
  22. -from compatibility import cmp_to_key
  23. +
  24. +from sympy.utilities.misc import default_sort_key
  25.  
  26. # internal marker to indicate:
  27. # "there are still non-commutative objects -- don't forget to process them"
  28. @@ -452,7 +453,7 @@ def flatten(cls, seq):
  29. return [coeff], [], order_symbols
  30.  
  31. # order commutative part canonically
  32. - c_part.sort(key=cmp_to_key(Basic.compare))
  33. + c_part.sort(key=default_sort_key)
  34.  
  35. # current code expects coeff to be always in slot-0
  36. if coeff is not S.One:
Add Comment
Please, Sign In to add comment