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
As mentioned in Pyramid's issue #2638, I would like to start adding type annotations to WebOb.
Since I don't really know the code base really well (I'm learning on the go!), I'm planning to make many little PRs so that they are easily reviewed and get feedbacks quickly (also because they should not affect runtime at all).
Can I get a green light on this?
Also, is it okay to make use of this issue to track progress? Google group is too noisy for my liking.
There is however a prevalent use of asymmetric properties and factory functions that create such properties, although you should be able to get away with relying on the protocols I defined. Although in the long run you may want to consider defining purpose-built descriptors, so there's less casting/type ignores.
There's also #452 that's slightly related to this, since the multidict implementation is currently not type safe. If we switch to the multidict package we will get type hints for free, we just need to add a new NestedMultiDict and NoVars implementation on top of the MultiMapping ABC.
Activity
Daverball commentedon Jan 31, 2025
FYI there are existing stubs for WebOb I contributed to typeshed that are fairly complete and should provide a good starting point: https://github.com/python/typeshed/tree/main/stubs/WebOb
There is however a prevalent use of asymmetric properties and factory functions that create such properties, although you should be able to get away with relying on the protocols I defined. Although in the long run you may want to consider defining purpose-built descriptors, so there's less casting/type ignores.
There's also #452 that's slightly related to this, since the multidict implementation is currently not type safe. If we switch to the
multidictpackage we will get type hints for free, we just need to add a newNestedMultiDictandNoVarsimplementation on top of theMultiMappingABC.