diff data_schema/__init__.py @ 49:6b8fcd0d2175

Use "==" instaead of "is" when comparing parent schemata. This fixes equality tests of Context instances.
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 03 Aug 2023 02:21:13 +0200
parents a0b464f6ab1f
children 682c32265978
line wrap: on
line diff
--- a/data_schema/__init__.py	Thu Aug 03 02:19:46 2023 +0200
+++ b/data_schema/__init__.py	Thu Aug 03 02:21:13 2023 +0200
@@ -377,7 +377,7 @@
     def __eq__(self, other):
         if not isinstance(other, _Schema):
             return NotImplemented
-        return (self.parent is other.parent
+        return ((self.parent == other.parent)
                 and bool(self.is_sub_root) == bool(other.is_sub_root)
                 and dict(self) == dict(other))
 
@@ -495,7 +495,7 @@
                 and (self._key_index == other._key_index)
 # XXX FIXME ???
 #                and (self.root_object == other.root_object)
-#                and (self.root_schema == other.root_schema)
+                and (self.root_schema == other.root_schema)
 #                and (self._current_object == other._current_object)
                 and (self._settings == other._settings)
         )