Skip to content

typing support in wsgiref #86178

Description

@srittau
mannequin
BPO 42012
Nosy @srittau, @pjeby, @JelleZijlstra, @corona10
PRs
  • gh-86178: Add wsgiref.types #32335
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-10-12.10:17:09.694>
    labels = ['type-feature', 'library']
    title = 'typing support in wsgiref'
    updated_at = <Date 2022-04-05.15:22:18.750>
    user = 'https://github.com/srittau'

    bugs.python.org fields:

    activity = <Date 2022-04-05.15:22:18.750>
    actor = 'srittau'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-10-12.10:17:09.694>
    creator = 'srittau'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42012
    keywords = ['patch']
    message_count = 2.0
    messages = ['378484', '416688']
    nosy_count = 4.0
    nosy_names = ['srittau', 'pje', 'JelleZijlstra', 'corona10']
    pr_nums = ['32335']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42012'
    versions = []

    Linked PRs

    Activity

    1. srittau commented on Oct 12, 2020

      srittaumannequin
      MannequinAuthor

      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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Oct 12, 2020
    3. JelleZijlstra commented on Apr 4, 2022

      @JelleZijlstra
      Member

      This seems useful to me but I don't have experience with wsgiref. pje is listed as the maintainer in the devguide but appears to be inactive.

      I'd suggest you open a PR and if anyone feels strongly against it, they can complain.

    4. transferred this issue fromon Apr 10, 2022
    5. added 2 commits that reference this issue on Apr 16, 2022
    6. kumaraditya303 commented on Apr 20, 2022

      @kumaraditya303
      Contributor

      Closing as the associated PR is merged and types are added now.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions