Skip to content

Commit

Permalink
Avoid unnecessary assignment/append
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Mar 17, 2024
1 parent 028797b commit 1b3898a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/attr/_make.py
Expand Up @@ -2305,9 +2305,7 @@ def _attrs_to_init_script(
If *frozen* is True, we cannot set the attributes directly so we use
a cached ``object.__setattr__``.
"""
lines = []
if pre_init:
lines.append("self.__attrs_pre_init__()")
lines = ["self.__attrs_pre_init__()"] if pre_init else []

if needs_cached_setattr:
lines.append(
Expand Down

0 comments on commit 1b3898a

Please sign in to comment.