Avoid unnecessary assignment/append

This commit is contained in:
Hynek Schlawack 2024-03-17 13:35:03 +01:00
parent 028797bd24
commit 1b3898a4b8
No known key found for this signature in database
1 changed files with 1 additions and 3 deletions

View File

@ -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(