File tree 1 file changed +7
-8
lines changed
src/mkdocstrings_handlers/python/_internal
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 43
43
_logger = get_logger (__name__ )
44
44
45
45
46
- def _sort_key_alphabetical (item : CollectorItem ) -> Any :
47
- # chr(sys.maxunicode) is a string that contains the final unicode
48
- # character, so if 'name' isn't found on the object, the item will go to
49
- # the end of the list.
46
+ def _sort_key_alphabetical (item : CollectorItem ) -> str :
47
+ # `chr(sys.maxunicode)` is a string that contains the final unicode character,
48
+ # so if `name` isn't found on the object, the item will go to the end of the list.
50
49
return item .name or chr (sys .maxunicode )
51
50
52
51
53
- def _sort_key_source (item : CollectorItem ) -> Any :
54
- # if ' lineno' is none, the item will go to the start of the list.
52
+ def _sort_key_source (item : CollectorItem ) -> float :
53
+ # If ` lineno` is none, the item will go to the end of the list.
55
54
if item .is_alias :
56
- return item .alias_lineno if item .alias_lineno is not None else - 1
57
- return item .lineno if item .lineno is not None else - 1
55
+ return item .alias_lineno if item .alias_lineno is not None else float ( "inf" )
56
+ return item .lineno if item .lineno is not None else float ( "inf" )
58
57
59
58
60
59
Order = Literal ["alphabetical" , "source" ]
You can’t perform that action at this time.
0 commit comments