Merged
Conversation
c5149f8 to
4093705
Compare
FichteFoll
requested changes
Jan 11, 2026
Member
FichteFoll
left a comment
There was a problem hiding this comment.
Are these the official stubs from the ST distribution?
Member
Author
|
Took original sublime.py and sublime_types.py, modified type hints to more modern format and added additional hints to satisfy mypy. Existing sublime_plugin.pyi was extended by missing classes and methods from official sublime_plugin.py |
FichteFoll
reviewed
Jan 11, 2026
Member
|
Perhaps we should add a mypy job to our PR lint workflow. |
c44e41c to
60b79f0
Compare
Member
|
#187 has been merged, so this can be rebased now. |
60b79f0 to
f620db9
Compare
1. typing in sublime.py and sublime_plugin.py was extended to minimize linter/mypy warnings. 2. auto-generated stubs via mypy's stubgen script. 3. Merged with existing stubs for EventListeners - Source files are from ST4202. - Only public end-points are kept. Most internal functions, methods, etc. are removed from stubs.
1. Typing expects python 3.10+ type checker to be used.
2. Runtime code is maintained compatible with python 3.8
Note: Needs some compromises compared to modern py3.13 expectations of typing,
to maintain compatibility with py3.8
f620db9 to
a619375
Compare
FichteFoll
approved these changes
Jan 18, 2026
Member
FichteFoll
left a comment
There was a problem hiding this comment.
mypy complains about usages of defined_guard, but to get this right we need ParamSpec generics, I believe, and those need Python 3.10+. Can be addressed when we drop 3.8.
Member
Author
|
Any ideas how to solve those warnings are welcome. |
deathaxe
added a commit
that referenced
this pull request
Jan 19, 2026
* Update stubs
1. typing in sublime.py and sublime_plugin.py was extended to minimize
linter/mypy warnings.
2. auto-generated stubs via mypy's stubgen script.
3. Merged with existing stubs for EventListeners
- Source files are from ST4202.
- Only public end-points are kept.
Most internal functions, methods, etc. are removed from stubs.
* Modernize type hints
1. Typing expects python 3.10+ type checker to be used.
2. Runtime code is maintained compatible with python 3.8
Note: Needs some compromises compared to modern py3.13 expectations of typing,
to maintain compatibility with py3.8
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.
This PR...
There are some mypy errors, which may require further investigation about how to fix...
Example: