@@ -119,7 +119,8 @@ in type annotations.
119
119
applications to set up dummy environments. It should NOT be used by actual WSGI
120
120
servers or applications, since the data is fake!
121
121
122
- Example usage::
122
+ Example usage (see also :func: `~wsgiref.simple_server.demo_app `
123
+ for another example)::
123
124
124
125
from wsgiref.util import setup_testing_defaults
125
126
from wsgiref.simple_server import make_server
@@ -312,6 +313,8 @@ request. (E.g., using the :func:`shift_path_info` function from
312
313
as :mod: `wsgiref.simple_server `) is able to run a simple WSGI application
313
314
correctly.
314
315
316
+ The *start_response * callable should follow the :class: `.StartResponse ` protocol.
317
+
315
318
316
319
.. class :: WSGIServer(server_address, RequestHandlerClass)
317
320
@@ -679,7 +682,9 @@ input, output, and error streams.
679
682
680
683
This method can access the current error using ``sys.exception() ``,
681
684
and should pass that information to *start_response * when calling it (as
682
- described in the "Error Handling" section of :pep: `3333 `).
685
+ described in the "Error Handling" section of :pep: `3333 `). In particular,
686
+ the *start_response * callable should follow the :class: `.StartResponse `
687
+ protocol.
683
688
684
689
The default implementation just uses the :attr: `error_status `,
685
690
:attr: `error_headers `, and :attr: `error_body ` attributes to generate an output
@@ -781,7 +786,7 @@ in :pep:`3333`.
781
786
.. versionadded :: 3.11
782
787
783
788
784
- .. class :: StartResponse()
789
+ .. class :: StartResponse
785
790
786
791
A :class: `typing.Protocol ` describing :pep: `start_response()
787
792
<3333#the-start-response-callable >`
@@ -816,7 +821,8 @@ in :pep:`3333`.
816
821
Examples
817
822
--------
818
823
819
- This is a working "Hello World" WSGI application::
824
+ This is a working "Hello World" WSGI application, where the *start_response *
825
+ callable should follow the :class: `.StartResponse ` protocol::
820
826
821
827
"""
822
828
Every WSGI application must have an application object - a callable
0 commit comments