diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index ef959466..6cf5f98d 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -11,6 +11,7 @@ import numpy as np import decimal, re import ctypes import sys, struct +from .pgcollections import OrderedDict from .python2_3 import asUnicode, basestring from .Qt import QtGui, QtCore, QT_LIB from . import getConfigOption, setConfigOptions @@ -446,11 +447,15 @@ def eq(a, b): if isinstance(a, dict) and isinstance(b, dict): if type(a) != type(b) or len(a) != len(b): return False - if sorted(a.keys()) != sorted(b.keys()): + if set(a.keys()) != set(b.keys()): return False - for k,v in a.items(): + for k, v in a.items(): if not eq(v, b[k]): return False + if isinstance(a, OrderedDict) or sys.version_info >= (3, 7): + for a_item, b_item in zip(a.items(), b.items()): + if not eq(a_item, b_item): + return False return True if isinstance(a, (list, tuple)) and isinstance(b, (list, tuple)): if type(a) != type(b) or len(a) != len(b):