Closed christophertubbs closed 1 year ago
asgiref.typing
provides types you can specify already e.g. HTTPScope
👍
A quick search doesn't show any real mention of the asgiref Scope TypedDict
s in the docs, so maybe there's room for me to help contribute to some of them. There's all sort of nifty stuff in there I was completely unaware of, so spreading that knowledge around could help new users.
Thanks for looking into this so fast.
self.scope
for Consumers is generally adict
-like object, meaning that its contents aren't very predictable and tools like IDEs can't predict what they will contain. In addition or instead of using thisdict
-like object, a specialized class could be used.A partial example would look like:
The inclusion of the internal
ConcreteScope.__scope
variable will ensure that most (if not all) functionality from the originalscope
variable is still provided, makingConcreteScope
a drop in replacement.