File size: 370 Bytes
9c6594c
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from sympy import And as SympyAnd
from sympy.core.sympify import sympify

class And(SympyAnd):
    """
    Patched version of And that keeps the _unsorted_args attribute
    """
    def __new__(cls, *args, **kwargs):
        args = [sympify(arg) for arg in args]
        obj = super().__new__(cls, *args, **kwargs)
        obj._unsorted_args = args
        return obj