|
1 | | -import sys |
2 | 1 | import warnings |
3 | 2 | from abc import ABC |
4 | 3 | from abc import abstractmethod |
@@ -814,32 +813,14 @@ def _check_multiple_trajectories(x, x_dot, u) -> bool: |
814 | 813 |
|
815 | 814 | """ |
816 | 815 | SequenceOrNone = Union[Sequence, None] |
817 | | - if sys.version_info.minor < 10: |
818 | | - mixed_trajectories = ( |
819 | | - isinstance(x, Sequence) |
820 | | - and ( |
821 | | - not isinstance(x_dot, Sequence) |
822 | | - and x_dot is not None |
823 | | - or not isinstance(u, Sequence) |
824 | | - and u is not None |
825 | | - ) |
826 | | - or isinstance(x_dot, Sequence) |
827 | | - and not isinstance(x, Sequence) |
828 | | - or isinstance(u, Sequence) |
829 | | - and not isinstance(x, Sequence) |
830 | | - ) |
831 | | - else: |
832 | | - mixed_trajectories = ( |
833 | | - isinstance(x, Sequence) |
834 | | - and ( |
835 | | - not isinstance(x_dot, SequenceOrNone) |
836 | | - or not isinstance(u, SequenceOrNone) |
837 | | - ) |
838 | | - or isinstance(x_dot, Sequence) |
839 | | - and not isinstance(x, Sequence) |
840 | | - or isinstance(u, Sequence) |
841 | | - and not isinstance(x, Sequence) |
842 | | - ) |
| 816 | + mixed_trajectories = ( |
| 817 | + isinstance(x, Sequence) |
| 818 | + and (not isinstance(x_dot, SequenceOrNone) or not isinstance(u, SequenceOrNone)) |
| 819 | + or isinstance(x_dot, Sequence) |
| 820 | + and not isinstance(x, Sequence) |
| 821 | + or isinstance(u, Sequence) |
| 822 | + and not isinstance(x, Sequence) |
| 823 | + ) |
843 | 824 | if mixed_trajectories: |
844 | 825 | raise TypeError( |
845 | 826 | "If x, x_dot, or u are a Sequence of trajectories, each must be a Sequence" |
|
0 commit comments