(self)
| 642 | return sum(1 for _ in self) |
| 643 | |
| 644 | def __iter__(self) -> cabc.Iterator[tuple[str, str]]: |
| 645 | for key, value in self.environ.items(): |
| 646 | if key.startswith("HTTP_") and key not in { |
| 647 | "HTTP_CONTENT_TYPE", |
| 648 | "HTTP_CONTENT_LENGTH", |
| 649 | }: |
| 650 | yield key[5:].replace("_", "-").title(), value |
| 651 | elif key in {"CONTENT_TYPE", "CONTENT_LENGTH"} and value: |
| 652 | yield key.replace("_", "-").title(), value |
| 653 | |
| 654 | def copy(self) -> t.NoReturn: |
| 655 | raise TypeError(f"cannot create {type(self).__name__!r} copies") |