Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
KeyBasedCompareMixin Class Reference
Inheritance diagram for KeyBasedCompareMixin:

Public Member Functions

None __init__ (self, Any key, Type["KeyBasedCompareMixin"] defining_class)
 
int __hash__ (self)
 
bool __lt__ (self, Any other)
 
bool __le__ (self, Any other)
 
bool __gt__ (self, Any other)
 
bool __ge__ (self, Any other)
 
bool __eq__ (self, Any other)
 

Protected Member Functions

bool _compare (self, Any other, Callable[[Any, Any], bool] method)
 

Protected Attributes

 _compare_key
 
 _defining_class
 

Detailed Description

Provides comparison capabilities that is based on a key

Definition at line 8 of file models.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ (   self,
Any  key,
Type["KeyBasedCompareMixin"]  defining_class 
)

Reimplemented in InstallationCandidate, and Link.

Definition at line 13 of file models.py.

13 def __init__(self, key: Any, defining_class: Type["KeyBasedCompareMixin"]) -> None:
14 self._compare_key = key
15 self._defining_class = defining_class
16

Referenced by Protocol.__init_subclass__().

Here is the caller graph for this function:

Member Function Documentation

◆ __eq__()

bool __eq__ (   self,
Any  other 
)

Definition at line 32 of file models.py.

32 def __eq__(self, other: Any) -> bool:
33 return self._compare(other, operator.__eq__)
34
for i

References KeyBasedCompareMixin._compare(), and i.

Referenced by Version.__ge__(), Version.__gt__(), Version.__le__(), Version.__ne__(), Matcher.__ne__(), Timestamp.__ne__(), and HTTPHeaderDict.__ne__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __ge__()

bool __ge__ (   self,
Any  other 
)

Definition at line 29 of file models.py.

29 def __ge__(self, other: Any) -> bool:
30 return self._compare(other, operator.__ge__)
31

References KeyBasedCompareMixin._compare(), and i.

Here is the call graph for this function:

◆ __gt__()

bool __gt__ (   self,
Any  other 
)

Definition at line 26 of file models.py.

26 def __gt__(self, other: Any) -> bool:
27 return self._compare(other, operator.__gt__)
28

References KeyBasedCompareMixin._compare(), and i.

Referenced by Version.__ge__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __hash__()

int __hash__ (   self)

Definition at line 17 of file models.py.

17 def __hash__(self) -> int:
18 return hash(self._compare_key)
19

References KeyBasedCompareMixin._compare_key.

Referenced by Style.__eq__(), and Style.__ne__().

Here is the caller graph for this function:

◆ __le__()

bool __le__ (   self,
Any  other 
)

Definition at line 23 of file models.py.

23 def __le__(self, other: Any) -> bool:
24 return self._compare(other, operator.__le__)
25

References KeyBasedCompareMixin._compare(), and i.

Here is the call graph for this function:

◆ __lt__()

bool __lt__ (   self,
Any  other 
)

Definition at line 20 of file models.py.

20 def __lt__(self, other: Any) -> bool:
21 return self._compare(other, operator.__lt__)
22

References KeyBasedCompareMixin._compare(), and i.

Referenced by Version.__gt__(), and Version.__le__().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _compare()

bool _compare (   self,
Any  other,
Callable[[Any, Any], bool]  method 
)
protected

Definition at line 35 of file models.py.

35 def _compare(self, other: Any, method: Callable[[Any, Any], bool]) -> bool:
36 if not isinstance(other, self._defining_class):
37 return NotImplemented
38
39 return method(self._compare_key, other._compare_key)

References KeyBasedCompareMixin._compare_key, KeyBasedCompareMixin._defining_class, and i.

Referenced by KeyBasedCompareMixin.__eq__(), KeyBasedCompareMixin.__ge__(), KeyBasedCompareMixin.__gt__(), KeyBasedCompareMixin.__le__(), and KeyBasedCompareMixin.__lt__().

Here is the caller graph for this function:

Field Documentation

◆ _compare_key

_compare_key
protected

Definition at line 14 of file models.py.

Referenced by KeyBasedCompareMixin.__hash__(), and KeyBasedCompareMixin._compare().

◆ _defining_class

_defining_class
protected

Definition at line 15 of file models.py.

Referenced by KeyBasedCompareMixin._compare().


The documentation for this class was generated from the following file: