You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doesn't work like I expected. It evaluates the git_gutter_settings.py file in the context of the importee and thus we end up using different instances of GitGutterSettings in different parts of the code. That is generally not a big problem apart when using flags like self._git_binary_path_error_shown where we rely on there being only one instance of GitGutterSettings.
I'm not sure what's the typical way of creating singletons in Python but that doesn't seem to be the right way.
The text was updated successfully, but these errors were encountered:
As far I know there is one set of moduls, which is initially loaded and an other set, which is used if you reload a module (e.g. work on it and save it or update it).
This could be avoided by using from GitGutter.git_gutter_settings import settings, but this would be problematic with the edge version.
In addition we could try in the git_gutter_settings.py something like (I haven't tested it):
IMO we don't really need to handle case when GitGutter code is modified. That's an edge case that should only affect GitGutter developers.
It would be enough that various git_gutter_*.py files use the same instance which is currently not the case.
This:
doesn't work like I expected. It evaluates the
git_gutter_settings.py
file in the context of the importee and thus we end up using different instances ofGitGutterSettings
in different parts of the code. That is generally not a big problem apart when using flags likeself._git_binary_path_error_shown
where we rely on there being only one instance ofGitGutterSettings
.I'm not sure what's the typical way of creating singletons in Python but that doesn't seem to be the right way.
The text was updated successfully, but these errors were encountered: