enable annotations=None by default
This commit is contained in:
parent
28562f73f6
commit
7130d26112
4 changed files with 45 additions and 3 deletions
|
|
@ -9,7 +9,15 @@ def annotation2key(aaa: int | float | str) -> tuple[bool, Any]:
|
|||
return (isinstance(aaa, str), aaa)
|
||||
|
||||
|
||||
def _normalized_annotations(annotations: annotations_t) -> annotations_t:
|
||||
if not annotations:
|
||||
return None
|
||||
return annotations
|
||||
|
||||
|
||||
def annotations_lt(aa: annotations_t, bb: annotations_t) -> bool:
|
||||
aa = _normalized_annotations(aa)
|
||||
bb = _normalized_annotations(bb)
|
||||
if aa is None:
|
||||
return bb is not None
|
||||
elif bb is None: # noqa: RET505
|
||||
|
|
@ -36,6 +44,8 @@ def annotations_lt(aa: annotations_t, bb: annotations_t) -> bool:
|
|||
|
||||
|
||||
def annotations_eq(aa: annotations_t, bb: annotations_t) -> bool:
|
||||
aa = _normalized_annotations(aa)
|
||||
bb = _normalized_annotations(bb)
|
||||
if aa is None:
|
||||
return bb is None
|
||||
elif bb is None: # noqa: RET505
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue