Skip to content

Commit 77f7d71

Browse files
committed
Shorten changelog and docstring for previous commit.
Also document the text parameter in other implementations.
1 parent 84859e1 commit 77f7d71

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎docs/project/changelog.rst‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ Improvements
4242

4343
* Added wheels for ARMv7, PowerPC, RISC-V, and S/390.
4444

45-
* Added the ``text`` argument to :func:`~asyncio.server.broadcast`, mirroring
46-
:meth:`~asyncio.connection.Connection.send`, to force sending a Text or
47-
Binary frame regardless of the type of ``message``.
45+
* Added an option to force :func:`~asyncio.connection.broadcast` to send
46+
:class:`bytes` in text frames, or :class:`str` in binary frames.
4847

4948
Bug fixes
5049
.........

‎src/websockets/asyncio/connection.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ async def send(
460460
461461
Args:
462462
message: Message to send.
463+
text: Force sending in a Text_ or Binary_ frame.
463464
464465
Raises:
465466
ConnectionClosed: When the connection is closed.
@@ -1202,8 +1203,7 @@ def broadcast(
12021203
websockets: WebSocket connections to which the message will be sent.
12031204
message: Message to send.
12041205
raise_exceptions: Whether to raise an exception in case of failures.
1205-
text: Send ``message`` in a Text_ frame if :obj:`True`, in a Binary_
1206-
frame if :obj:`False`, or according to its type if :obj:`None`.
1206+
text: Force sending in Text_ or Binary_ frames.
12071207
12081208
Raises:
12091209
TypeError: If ``message`` doesn't have a supported type.

‎src/websockets/sync/connection.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ def send(
455455
456456
Args:
457457
message: Message to send.
458+
text: Force sending in a Text_ or Binary_ frame.
458459
459460
Raises:
460461
ConnectionClosed: When the connection is closed.

‎src/websockets/trio/connection.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ async def send(
472472
473473
Args:
474474
message: Message to send.
475+
text: Force sending in a Text_ or Binary_ frame.
475476
476477
Raises:
477478
ConnectionClosed: When the connection is closed.

0 commit comments

Comments
 (0)