Skip to content

Two SettingsDict should be equal if they refer to the same internal settings #129

@Thom1729

Description

@Thom1729

A sublime.Settings object has a numeric settings_id that it passes to the internal API. Two Settings with the same settings_id are interchangeable for all practical purposes. By extension, the same is true for SettingsDict objects. Should SettingsDict reflect this?:

def __eq__(self, other):
    return isinstance(other, SettingsDict) and self.settings.settings_id == other.settings.settings_id

Under this implementation, SettingsDict and NamedSettingsDict objects could compare equal. I don't have a strong opinion on whether they should; perhaps not, since they're not interchangeable objects.

(Also: __hash__?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions