Skip to content

Commit 447f8a4

Browse files
committed
Tuples are cheaper than lists
1 parent 4b1d869 commit 447f8a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/attr/_make.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,7 @@ def _determine_setters(frozen, slots, base_attr_map):
22522252
"""
22532253
if frozen is True:
22542254
if slots is True:
2255-
return [], _setattr, _setattr_with_converter
2255+
return (), _setattr, _setattr_with_converter
22562256

22572257
# Dict frozen classes assign directly to __dict__.
22582258
# But only if the attribute doesn't come from an ancestor slot
@@ -2278,13 +2278,13 @@ def fmt_setter_with_converter(attr_name, value_var, has_on_setattr):
22782278
)
22792279

22802280
return (
2281-
["_inst_dict = self.__dict__"],
2281+
("_inst_dict = self.__dict__",),
22822282
fmt_setter,
22832283
fmt_setter_with_converter,
22842284
)
22852285

22862286
# Not frozen -- we can just assign directly.
2287-
return [], _assign, _assign_with_converter
2287+
return (), _assign, _assign_with_converter
22882288

22892289

22902290
def _attrs_to_init_script(

0 commit comments

Comments
 (0)