Back to Aiohttp

7319.Feature

CHANGES/7319.feature.rst

4.0.0a1429 B
Original Source

Changed WSMessage to a tagged union of NamedTuple -- by :user:Dreamsorcerer.

This change allows type checkers to know the precise type of data after checking the type attribute.

If accessing messages by tuple indexes, the order has now changed. Code such as: typ, data, extra = ws_message will need to be changed to: data, extra, typ = ws_message

No changes are needed if accessing by attribute name.