Skip to content

Commit f652160

Browse files
authored
Apply suggestion from code review
1 parent 0ec8d8e commit f652160

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎docs/spec/qualifiers.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ necessary to create a final class variable with value ``3``. In
164164
non-dataclasses, combining ``ClassVar`` and ``Final`` is redundant, and type
165165
checkers may choose to warn or error on the redundancy.
166166

167-
``Final`` attributes can also be declared in and *only* in ``__init__``
168-
methods, so that the final instance attribute is assigned only once when an
169-
instance is created::
167+
``Final`` attributes can also be declared in ``__init__`` methods, as
168+
annotations on an assignment to an attribute on ``self``. This is allowed
169+
*only* in ``__init__``, not in any other method::
170170

171171
class ImmutableAttributes:
172172
def __init__(self) -> None:

0 commit comments

Comments
 (0)