Skip to content

Commit 1b3898a

Browse files
committed
Avoid unnecessary assignment/append
1 parent 028797b commit 1b3898a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/attr/_make.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,9 +2305,7 @@ def _attrs_to_init_script(
23052305
If *frozen* is True, we cannot set the attributes directly so we use
23062306
a cached ``object.__setattr__``.
23072307
"""
2308-
lines = []
2309-
if pre_init:
2310-
lines.append("self.__attrs_pre_init__()")
2308+
lines = ["self.__attrs_pre_init__()"] if pre_init else []
23112309

23122310
if needs_cached_setattr:
23132311
lines.append(

0 commit comments

Comments
 (0)