Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Jul 24, 2024
1 parent fe0a173 commit f4987a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ Other Language Changes
command line option. For example, ``python -O -c 'assert await 1'``
now produces a :exc:`SyntaxError`. (Contributed by Jelle Zijlstra in :gh:`121637`.)

* Writes to ``__debug__`` are now detected even if the code is optimized
away by the :option:`-O` command line option. For example,
``python -O -c 'assert (__debug__ := 1)'`` now produces a
:exc:`SyntaxError`. (Contributed by Irit Katriel in :gh:`122245`.)

* Added class methods :meth:`float.from_number` and :meth:`complex.from_number`
to convert a number to :class:`float` or :class:`complex` type correspondingly.
They raise an error if the argument is a string.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Detection of writes to ``__debug__`` is moved from the compiler's codegen
stage to the symtable. This means that these errors now detected even in
code that is optimized away before codegen (such as assertions with the
:option:`-O` command line option.)

0 comments on commit f4987a5

Please sign in to comment.