Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typing support in wsgiref #86178

Closed
srittau mannequin opened this issue Oct 12, 2020 · 3 comments
Closed

typing support in wsgiref #86178

srittau mannequin opened this issue Oct 12, 2020 · 3 comments
Labels
expert-typing stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@srittau
Copy link
Mannequin

srittau mannequin commented Oct 12, 2020

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 = []

    @srittau
    Copy link
    Mannequin Author

    srittau mannequin commented Oct 12, 2020

    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.

    @srittau srittau mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Oct 12, 2020
    @JelleZijlstra
    Copy link
    Member

    JelleZijlstra commented Apr 4, 2022

    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.

    @kumaraditya303
    Copy link
    Contributor

    kumaraditya303 commented Apr 20, 2022

    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
    Labels
    expert-typing stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants