[New-bugs-announce] [issue42012] typing support in wsgiref

Sebastian Rittau report at bugs.python.org
Mon Oct 12 06:17:09 EDT 2020


New submission from Sebastian Rittau <srittau at rittau.biz>:

In typeshed (the repository for stdlib type annotations), we have defined a bunch of types to support annotating WSGI interfaces. See https://github.com/python/typeshed/blob/master/stdlib/2and3/_typeshed/wsgi.pyi for the current version. Unfortunately these types are only available at type check time, which means that users need to do some gymnastics to use them in their own code.

I think it would be worthwhile to add these types directly to wsgiref or to a new module (e.g. wsgiref.types). On the one hand users could use them at runtime easily, on the other hand they serve as additional documentation WSGI types. In my experience, WSGI applications and middleware often slightly misimplement the standard, which can make interoperability difficult. Both type checking and concrete documentation could help alleviate this problem.

If the maintainers think this would be a good idea, I could provide a PR for both the types and the Python documentation.

----------
components: Library (Lib)
messages: 378484
nosy: srittau
priority: normal
severity: normal
status: open
title: typing support in wsgiref
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42012>
_______________________________________


More information about the New-bugs-announce mailing list