MCPcopy
hub / github.com/pallets/werkzeug / set

Method set

src/werkzeug/datastructures/range.py:170–184  ·  view source on GitHub ↗

Simple method to update the ranges.

(
        self,
        start: int | None,
        stop: int | None,
        length: int | None = None,
        units: str | None = "bytes",
    )

Source from the content-addressed store, hash-verified

168 length: int | None = _CallbackProperty() # type: ignore[assignment]
169
170 def set(
171 self,
172 start: int | None,
173 stop: int | None,
174 length: int | None = None,
175 units: str | None = "bytes",
176 ) -> None:
177 """Simple method to update the ranges."""
178 assert http.is_byte_range_valid(start, stop, length), "Bad range provided"
179 self._units: str | None = units
180 self._start: int | None = start
181 self._stop: int | None = stop
182 self._length: int | None = length
183 if self.on_update is not None:
184 self.on_update(self)
185
186 def unset(self) -> None:
187 """Sets the units to `None` which indicates that the header should

Callers 2

__init__Method · 0.95
unsetMethod · 0.95

Calls 1

on_updateMethod · 0.45

Tested by

no test coverage detected