Registry / type-stubs / types-waitress

types-waitress

JSON →
library3.0.1.20260508pypypiunverified

This is a type stub package for the `waitress` WSGI server, providing static type annotations for use with type checkers like MyPy and Pyright. It allows developers to leverage type checking for `waitress` without modifying its runtime code. The current version is 3.0.1.20260408 and it is released as part of the `typeshed` project, with updates for third-party stubs typically occurring up to once a day.

pip install types-waitress
INSTALL
IMPORT
SIG · TYPES-WAITRESS
T
types-waitress
type-stubspythonv3.0.1.20260508
Install
1.5s avg
Import
73ms
Disk
65MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.1.20260508 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.078s · 65.9MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 1.5s · import 0.069s · 18MB
65MB installed
● package 65MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

serve
from waitress_stubs import serve
from waitress-stubs import serve

This quickstart demonstrates a basic WSGI application that can be served by `waitress`. After installing `waitress` and `types-waitress`, a type checker like MyPy can validate the types used in the `simple_app` and `serve` call against the provided stubs, catching potential errors at development time. The example includes the recommended type hints for a WSGI application.

# app.py from wsgiref.simple_server import make_server from waitress import serve from typing import Callable, Iterable, Dict, Any def simple_app(environ: Dict[str, Any], start_response: Callable) -> Iterable[bytes]: """A barebones WSGI application with type hints.""" status = '200 OK' headers = [('Content-type', 'text/plain; charset=utf-8')] start_response(status, headers) return [b"Hello, Waitress with types!"] if __name__ == '__main__': print("Serving on http://127.0.0.1:8080") # Typical production deployment would use the command line: # waitress-serve --host=127.0.0.1 --port=8080 app:simple_app # For direct Python execution: serve(simple_app, host='127.0.0.1', port=8080) # To type check this application: # 1. Ensure you have a type checker installed, e.g., pip install mypy # 2. Run the type checker from your terminal: mypy app.py
Debug
Known issues
gotchaType stub packages like `types-waitress` must be kept in sync with the runtime library (`waitress`) they annotate. If the `waitress` version updates significantly and `types-waitress` does not, type checking might produce false positives or miss actual errors.
fix
Regularly update both `waitress` and `types-waitress`. Pin `types-waitress` to match the major.minor version of `waitress` (e.g., if `waitress==3.0.x`, use `types-waitress==3.0.x.YYYYMMDD`).
affects: All versions
breakingEven minor changes within type stubs can sometimes lead to new type-checking errors, even if the underlying runtime code functions identically. This is because type checkers might become stricter or new type features are used in stubs that break compatibility with older type checker versions.
fix
Pin your type checker (e.g., `mypy==1.19.1`) along with your stub packages if strict type checking stability is critical. Consult the `typeshed` documentation for compatibility with specific type checker versions.
affects: All versions
gotchaThe naming convention `types-<library_name>` for stub-only packages from `typeshed` means you install `types-waitress` but still import from `waitress`. New users sometimes expect to import from the stub package directly.
fix
Always import symbols from the original runtime library (`waitress`). The type checker automatically finds and applies the type information from the installed `types-waitress` package.
affects: All versions
Upgrade
Version history
3.0.1.20260508latest on PyPI · released May 8, 2026
Audit
Dependencies
waitressrequiredProvides the runtime functionality for which these stubs offer type hints. This `types-waitress` version aims to provide annotations for `waitress~=3.0.1`.
pythonrequiredMinimum Python version required for the `types-waitress` package itself.
Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
types-waitress — pip install types-waitress · libregistry