File tree Expand file tree Collapse file tree 4 files changed +17
-10
lines changed
Expand file tree Collapse file tree 4 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: MIT
22
33import os
4- import sys
54
65from importlib import metadata
76from pathlib import Path
Original file line number Diff line number Diff line change @@ -931,9 +931,12 @@ def _create_slots_class(self):
931931 additional_closure_functions_to_update .append (original_getattr )
932932
933933 cd ["__getattr__" ] = _make_cached_property_getattr (
934- {name : prop .func for (name , prop ) in cached_properties .items ()},
934+ {
935+ name : prop .func
936+ for (name , prop ) in cached_properties .items ()
937+ },
935938 original_getattr ,
936- self ._cls
939+ self ._cls ,
937940 )
938941
939942 # We only add the names of attributes that aren't inherited.
Original file line number Diff line number Diff line change 33from sphinx .application import Sphinx
44
55
6- def get_cached_property_for_member_descriptor (cls : type , name : str , default = None ):
7- props = getattr (cls , "__attrs_cached_properties__" , None )
8- if props is None or name not in props :
9- return getattr (cls , name , default )
10- return props [name ]
6+ def get_cached_property_for_member_descriptor (
7+ cls : type , name : str , default = None
8+ ):
9+ props = getattr (cls , "__attrs_cached_properties__" , None )
10+ if props is None or name not in props :
11+ return getattr (cls , name , default )
12+ return props [name ]
13+
1114
1215def setup (app : Sphinx ):
13- app .add_autodoc_attrgetter (object , get_cached_property_for_member_descriptor )
16+ app .add_autodoc_attrgetter (
17+ object , get_cached_property_for_member_descriptor
18+ )
Original file line number Diff line number Diff line change 11.. autoclass :: tests.test_slots.SphinxDocTest
22
3- .. autoproperty :: documented
3+ .. autoproperty :: documented
You can’t perform that action at this time.
0 commit comments