From 5ff2187382ee95dd71f52839bad915e37fdb78be Mon Sep 17 00:00:00 2001 From: Shantanu Jain Date: Sat, 28 Dec 2024 18:39:14 -0800 Subject: [PATCH 1/2] Add some highlights to changelog --- CHANGELOG.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bae57dd1b0e7..8c61a185a0cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,25 @@ ## Next release -... +## `--strict-bytes` + +By default, mypy treats an annotation of ``bytes`` as permitting ``bytearray`` and ``memoryview``. +[PEP 688](https://peps.python.org/pep-0688) specified the removal of this special case. +Use this flag to disable this behavior. `--strict-bytes` will be enabled by default in *mypy 2.0*. + +Contributed by Ali Hamdan (PR [18137](https://github.com/python/mypy/pull/18263/)) and +Shantanu Jain (PR [13952](https://github.com/python/mypy/pull/13952)). + +## Improvements to partial type handling in loops + +This change results in mypy better modelling control flow within loops and hence detecting several +issues it previously did not detect. In some cases, this change may require use of an additional +explicit annotation of a variable. + +Contributed by Christoph Tyralla (PR [18180](https://github.com/python/mypy/pull/18180)). + +(Speaking of partial types, another reminder that mypy plans on enabling `--local-partial-types` +by default in *mypy 2.0*). ## Mypy 1.14 From d6dc92359e95c9f5971c4bc4c5f0156c3763572e Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 29 Dec 2024 14:06:09 -0800 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c61a185a0cf..fb4bbc3afe7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,16 @@ ## Next release -## `--strict-bytes` +### `--strict-bytes` By default, mypy treats an annotation of ``bytes`` as permitting ``bytearray`` and ``memoryview``. [PEP 688](https://peps.python.org/pep-0688) specified the removal of this special case. -Use this flag to disable this behavior. `--strict-bytes` will be enabled by default in *mypy 2.0*. +Use this flag to disable this behavior. `--strict-bytes` will be enabled by default in **mypy 2.0**. Contributed by Ali Hamdan (PR [18137](https://github.com/python/mypy/pull/18263/)) and Shantanu Jain (PR [13952](https://github.com/python/mypy/pull/13952)). -## Improvements to partial type handling in loops +### Improvements to partial type handling in loops This change results in mypy better modelling control flow within loops and hence detecting several issues it previously did not detect. In some cases, this change may require use of an additional @@ -20,7 +20,7 @@ explicit annotation of a variable. Contributed by Christoph Tyralla (PR [18180](https://github.com/python/mypy/pull/18180)). (Speaking of partial types, another reminder that mypy plans on enabling `--local-partial-types` -by default in *mypy 2.0*). +by default in **mypy 2.0**). ## Mypy 1.14