-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
enhancement requestNew feature or requestNew feature or request
Description
Hello,
in a way, this is similar to #2606 (Scope-level comments).
Here, I ask you to add the capability to let comments decide what to ignore, disable or enable within the boundaries of entire blocks of code.
For instance:
# pyright: strict
def func():
# pyright: disable=reportUnknownMemberType
socket = self.socket.accept()
socket.invoke_another_urecognised_method()
# pyright: enable=reportUnknownMemberType
# We are back to the strict mode now
...This could work across functions or probably any lines of code, which is why it is not the same as #2606:
# pyright: strict
# pyright: disable=reportUnknownMemberType
def func1():
...
def func2():
...
# pyright: enable=reportUnknownMemberType
# Back to strict nowHowever, making it work with completely arbitrary blocks would be likely impractical and academic, e.g. I do not see any use case for such comments to begin in the middle of one function only to end in the middle of another.
Yet, I can definitely see it work across a few functions, a handful of related classes etc.
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancement requestNew feature or requestNew feature or request