Skip to content

Commit 01401bd

Browse files
committed
Revert unrelated ruff style changes from previous commit
1 parent 280f94b commit 01401bd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/dataclasses.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ def add_fns_to_class(self, cls):
520520
if already_exists and (msg_extra := self.overwrite_errors.get(name)):
521521
error_msg = (f'Cannot overwrite attribute {fn.__name__} '
522522
f'in class {cls.__name__}')
523-
if msg_extra is not True:
523+
if not msg_extra is True:
524524
error_msg = f'{error_msg} {msg_extra}'
525525

526526
raise TypeError(error_msg)
@@ -729,14 +729,14 @@ def _frozen_set_del_attr(cls, fields, func_builder):
729729
('self', 'name', 'value'),
730730
(f' if {condition}:',
731731
' raise FrozenInstanceError(f"cannot assign to field {name!r}")',
732-
' super(__class__, self).__setattr__(name, value)'),
732+
f' super(__class__, self).__setattr__(name, value)'),
733733
locals=locals,
734734
overwrite_error=True)
735735
func_builder.add_fn('__delattr__',
736736
('self', 'name'),
737737
(f' if {condition}:',
738738
' raise FrozenInstanceError(f"cannot delete field {name!r}")',
739-
' super(__class__, self).__delattr__(name)'),
739+
f' super(__class__, self).__delattr__(name)'),
740740
locals=locals,
741741
overwrite_error=True)
742742

@@ -1099,7 +1099,7 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen,
10991099

11001100
# Do we have any Field members that don't also have annotations?
11011101
for name, value in cls.__dict__.items():
1102-
if isinstance(value, Field) and name not in cls_annotations:
1102+
if isinstance(value, Field) and not name in cls_annotations:
11031103
raise TypeError(f'{name!r} is a field but has no type annotation')
11041104

11051105
# Check rules that apply if we are derived from any dataclasses.

0 commit comments

Comments
 (0)