Skip to content

Commit d01f0c6

Browse files
committed
Update docs for byte literals
1 parent 08efd38 commit d01f0c6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/source/change_log.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Version 5.0.0
1515
* **Breaking:** Dropped support for Python versions 3.6, 3.7 and 3.8
1616
* **Breaking:** Changed the precedence of operators to be more aligned with common programming languages
1717
* **Breaking:** The :ref:`debug-repl` utility now requires development dependencies to be installed
18+
* **Breaking:** BYTES literals now throw exceptions for invalid escape sequences
1819

1920
Version 4.x.x
2021
-------------

docs/source/syntax.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,15 @@ difference comes in an optional leading character before the opening quote. Eith
286286
``s`` will specify a standard :py:attr:`~.DataType.STRING` value, while a single ``d`` will specify a
287287
:py:attr:`~.DataType.DATETIME` value, and a single ``t`` will specify a :py:attr:`~.DataType.TIMEDELTA` value.
288288

289+
.. _literal-bytes-values:
290+
291+
Literal BYTES Values
292+
""""""""""""""""""""
293+
294+
:py:attr:`~.DataType.BYTES` literals are strings prefixed with ``b`` followed by either a single or double quote. The
295+
contents of the string may use escape sequences by specifying ``\`` followed by a single selection of ``tnr"'\`` or
296+
``x`` followed by two hexadecimal digits.
297+
289298
.. _literal-datetime-values:
290299

291300
Literal DATETIME Values

0 commit comments

Comments
 (0)