Implement iteration-based method for SettingsDict#201
Open
FichteFoll wants to merge 9 commits intomasterfrom
Open
Implement iteration-based method for SettingsDict#201FichteFoll wants to merge 9 commits intomasterfrom
SettingsDict#201FichteFoll wants to merge 9 commits intomasterfrom
Conversation
This implementation is closer to the type annotations (we specifically support `dict`s and not arbitrary mappings) and follows the described behavior of `dict.update` which iterates over the `dict`'s keys. Additionally, adjust the typing annotation for the iterable version to iterate over 2-tuples instead of `Iterable[str]`, which is closer to the reality. To my knowledge, it is not possible to express a 2-element iterable with two distinct types in the current type system.
Also move caveat explanations to the class-level docstring.
I forgot that we dropped support for the non-3.8 host already.
This aligns with the native dict signature.
deathaxe
reviewed
Feb 21, 2026
Member
deathaxe
left a comment
There was a problem hiding this comment.
Haven't seen anyone using this class anywhere. There were probably good reasons for sublimehq to not natively implement Settings as a full Mapping. Regardless, this commit fills some gaps between Settings and Mappings.
Member
Author
|
Before merging this, I should implement some tests and have them pass locally at least. |
Also adjust documentation accordingly.
mypy does not require these (anymore). ty does, but we don't use that here.
deathaxe
reviewed
Feb 22, 2026
| from collections.abc import Mapping | ||
|
|
||
| import sublime | ||
| from sublime_types import Value |
Member
There was a problem hiding this comment.
Note, sublime_types being available as of ST4135+. Seems this change requires falling back to home grown Value type again :/
Member
Author
|
Feel free to continue with adding tests to this PR, btw. I won't work on it again until at least Friday. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the methods that can reasonably be implemented using
Settings.to_dict(self)and adjusts docstrings accordingly.Closes #139