from starlette.middleware.base import BaseHTTPMiddleware
from starlette.types import ASGIApp, Receive, Scope, Send
class CashMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request, call_next): # "self" is not accessed Pylance
response = await call_next(request)
response.headers['Custom'] = 'Example'
return response
The symbol "self" is not accessed in the above snippet. All unaccessed function parameters are displayed as "grayed out" by Pylance as a subtle hint that it is not accessed. This is how it is intended to work.
Yeah, this is intended in order to get the graying out behavior. VS Code shouldn't show squiggles, just the visual effect (and doesn't show up in the "problems" panel either).
See #434 (but I believe there are others).
thx
Most helpful comment
Yeah, this is intended in order to get the graying out behavior. VS Code shouldn't show squiggles, just the visual effect (and doesn't show up in the "problems" panel either).
See #434 (but I believe there are others).