Skip to content

Commit 35877fb

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 716d219 commit 35877fb

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/attr/_make.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,9 @@ def _make_cached_property_uncached(original_cached_property_func, cls):
567567
doc_lines.append("\n")
568568
doc_lines.append('"""')
569569

570-
annotation = inspect.signature(original_cached_property_func).return_annotation
570+
annotation = inspect.signature(
571+
original_cached_property_func
572+
).return_annotation
571573
if annotation is inspect.Parameter.empty:
572574
defline = f"def {name}(self):"
573575
else:
@@ -576,11 +578,15 @@ def _make_cached_property_uncached(original_cached_property_func, cls):
576578
"@property",
577579
defline,
578580
*(" " + line for line in doc_lines),
579-
f" return self.__getattr__('{name}_cache')"
581+
f" return self.__getattr__('{name}_cache')",
580582
]
581-
unique_filename = _generate_unique_filename(cls, original_cached_property_func)
583+
unique_filename = _generate_unique_filename(
584+
cls, original_cached_property_func
585+
)
582586
glob = {"original_cached_property": original_cached_property_func}
583-
return _linecache_and_compile("\n".join(lines), unique_filename, glob)[name]
587+
return _linecache_and_compile("\n".join(lines), unique_filename, glob)[
588+
name
589+
]
584590

585591

586592
def _frozen_setattrs(self, name, value):
@@ -950,7 +956,7 @@ def _create_slots_class(self):
950956
class_annotations = _get_annotations(self._cls)
951957
for name, func in cached_properties.items():
952958
# Add cached properties to names for slotting.
953-
names += (name + '_cache',)
959+
names += (name + "_cache",)
954960
# Clear out function from class to avoid clashing.
955961
del cd[name]
956962
additional_closure_functions_to_update.append(func)

0 commit comments

Comments
 (0)