Comparison to another SON is order-sensitive while comparison to a regular dictionary is order-insensitive.
(self, other: Any)
| 184 | return default |
| 185 | |
| 186 | def __eq__(self, other: Any) -> bool: |
| 187 | """Comparison to another SON is order-sensitive while comparison to a |
| 188 | regular dictionary is order-insensitive. |
| 189 | """ |
| 190 | if isinstance(other, SON): |
| 191 | return len(self) == len(other) and list(self.items()) == list(other.items()) |
| 192 | return cast(bool, self.to_dict() == other) |
| 193 | |
| 194 | def __ne__(self, other: Any) -> bool: |
| 195 | return not self == other |