GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-86178: Add wsgiref.types by srittau · Pull Request #32335 · python/cpython Conversation
| ||||||||||||||||||||||||||||||||||
|
My first thought when I saw this was, "How will we ensure that these types remain up to date with the rest of the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
These types are just a representation of PEP 3333, not of the specifics of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| :synopsis: WSGI types for static type checking | ||
|
|
||
|
|
||
| This module provides various types for static type checking as described |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This documentation feels a bit thin. Perhaps we could have examples of WSGI code using some of these aliases.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I agree about the examples, but when I procrastinated over two options, I gave up :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| @@ -0,0 +1,53 @@ | |||
| """WSGI-related types for static type checking""" | |||
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It might be good to add a note to the module docstring that any changes contributors want to make to this file will need to be made to typeshed simultaneously if they're to have any meaning to static type checkers
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should mention typeshed explicitly for a few reasons:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'll merge this in a few days unless more feedback comes up. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| class ErrorStream(Protocol): | ||
| """WSGI error stream as defined in PEP 3333""" | ||
| def flush(self) -> None: ... | ||
| def write(self, s: str, /) -> None: ... |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This should probably be -> object. File objects typically return the number of bytes written as int.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same for flush, although that doesn't typically return anything.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a bit embarrassing. :) Will fix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.