Skip to content

Commit e55acbb

Browse files
committed
wsgiref: indicate that start_response objects should follow a specific protocol
1 parent bf21e21 commit e55acbb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Doc/library/wsgiref.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ in type annotations.
119119
applications to set up dummy environments. It should NOT be used by actual WSGI
120120
servers or applications, since the data is fake!
121121

122-
Example usage::
122+
Example usage, where the *start_response* callable should follow the
123+
:class:`StartResponse` protocol::
123124

124125
from wsgiref.util import setup_testing_defaults
125126
from wsgiref.simple_server import make_server
@@ -312,6 +313,9 @@ request. (E.g., using the :func:`shift_path_info` function from
312313
as :mod:`wsgiref.simple_server`) is able to run a simple WSGI application
313314
correctly.
314315

316+
The *start_response* callable should follow the :class:`StartResponse`
317+
protocol.
318+
315319

316320
.. class:: WSGIServer(server_address, RequestHandlerClass)
317321

@@ -679,7 +683,9 @@ input, output, and error streams.
679683

680684
This method can access the current error using ``sys.exception()``,
681685
and should pass that information to *start_response* when calling it (as
682-
described in the "Error Handling" section of :pep:`3333`).
686+
described in the "Error Handling" section of :pep:`3333`). In particular,
687+
the *start_response* callable should follow the :class:`StartResponse`
688+
protocol.
683689

684690
The default implementation just uses the :attr:`error_status`,
685691
:attr:`error_headers`, and :attr:`error_body` attributes to generate an output
@@ -781,7 +787,7 @@ in :pep:`3333`.
781787
.. versionadded:: 3.11
782788

783789

784-
.. class:: StartResponse()
790+
.. class:: StartResponse
785791

786792
A :class:`typing.Protocol` describing :pep:`start_response()
787793
<3333#the-start-response-callable>`
@@ -816,7 +822,8 @@ in :pep:`3333`.
816822
Examples
817823
--------
818824

819-
This is a working "Hello World" WSGI application::
825+
This is a working "Hello World" WSGI application, where the *start_response*
826+
callable should follow the :class:`StartResponse` protocol::
820827

821828
"""
822829
Every WSGI application must have an application object - a callable

0 commit comments

Comments
 (0)