Skip to content

Upgrading async-timeout 3 to 4

Breaking3.0.1 → 4.0.3Breaking2Platform2Deprecated1New3Changed1Fixed2

BreakingUpgrade verdict

2 breaking changes and 2 platform requirement changes.

  • The remaining-time property is gone; subtract the current loop time from the deadline instead.
  • The relative-timeout property is removed; read the absolute deadline property instead.
  • The package can now be used on Python 3.11.
  • Python 3.6 is no longer supported; users on 3.6 must upgrade Python to use this version.
5 items need code or config changes

Python requirement changed in 4.0.3: >=3.5.3 → >=3.7.

Breaking2
Drops the timeout.remaining property; compute it as timeout.deadline - loop.time().
timeout.remainingtimeout.deadlineloop.time()
Drops the timeout.timeout property; use the absolute timeout.deadline instead.
timeout.timeouttimeout.deadline
Platform2
Adds support for Python 3.11.
Drops support for Python 3.6.
Deprecated1
Deprecates synchronous context manager usage.

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • removed: class timeout
  • removed: constructor timeout(timeout: Optional[float], *, loop: Optional[asyncio.AbstractEventLoop]=…) -> None
  • removed: function current_task(loop: asyncio.AbstractEventLoop) -> asyncio.Task[Any]
  • removed: property timeout.expired -> bool
  • removed: property timeout.remaining -> Optional[float]
  • removed: variable PY_37
  • added: class Timeout
  • added: constructor Timeout(deadline: Optional[float], loop: asyncio.AbstractEventLoop) -> None
  • added: function timeout(delay: Optional[float]) -> Timeout
  • added: function timeout_at(deadline: Optional[float]) -> Timeout
  • added: method Timeout.reject() -> None
  • added: method Timeout.shift(delay: float) -> None
  • added: method Timeout.update(deadline: float) -> None
  • added: property Timeout.deadline -> Optional[float]
  • added: property Timeout.expired -> bool