@@ -1312,7 +1312,7 @@ def __iter__(self) -> Iterator[str]:
1312
1312
if self [key ]:
1313
1313
yield key
1314
1314
1315
- def __iadd__ (self , other : Distribution | Environment ):
1315
+ def __iadd__ (self , other : Distribution | Environment ) -> Self :
1316
1316
"""In-place addition of a distribution or environment"""
1317
1317
if isinstance (other , Distribution ):
1318
1318
self .add (other )
@@ -1324,7 +1324,7 @@ def __iadd__(self, other: Distribution | Environment):
1324
1324
raise TypeError ("Can't add %r to environment" % (other ,))
1325
1325
return self
1326
1326
1327
- def __add__ (self , other : Distribution | Environment ):
1327
+ def __add__ (self , other : Distribution | Environment ) -> Self :
1328
1328
"""Add an environment or distribution to an environment"""
1329
1329
new = self .__class__ ([], platform = None , python = None )
1330
1330
for env in self , other :
@@ -2371,7 +2371,7 @@ class NoDists:
2371
2371
[]
2372
2372
"""
2373
2373
2374
- def __bool__ (self ):
2374
+ def __bool__ (self ) -> Literal [ False ] :
2375
2375
return False
2376
2376
2377
2377
def __call__ (self , fullpath : object ):
@@ -2970,28 +2970,28 @@ def hashcmp(self):
2970
2970
self .platform or '' ,
2971
2971
)
2972
2972
2973
- def __hash__ (self ):
2973
+ def __hash__ (self ) -> int :
2974
2974
return hash (self .hashcmp )
2975
2975
2976
- def __lt__ (self , other : Distribution ):
2976
+ def __lt__ (self , other : Distribution ) -> bool :
2977
2977
return self .hashcmp < other .hashcmp
2978
2978
2979
- def __le__ (self , other : Distribution ):
2979
+ def __le__ (self , other : Distribution ) -> bool :
2980
2980
return self .hashcmp <= other .hashcmp
2981
2981
2982
- def __gt__ (self , other : Distribution ):
2982
+ def __gt__ (self , other : Distribution ) -> bool :
2983
2983
return self .hashcmp > other .hashcmp
2984
2984
2985
- def __ge__ (self , other : Distribution ):
2985
+ def __ge__ (self , other : Distribution ) -> bool :
2986
2986
return self .hashcmp >= other .hashcmp
2987
2987
2988
- def __eq__ (self , other : object ):
2988
+ def __eq__ (self , other : object ) -> bool :
2989
2989
if not isinstance (other , self .__class__ ):
2990
2990
# It's not a Distribution, so they are not equal
2991
2991
return False
2992
2992
return self .hashcmp == other .hashcmp
2993
2993
2994
- def __ne__ (self , other : object ):
2994
+ def __ne__ (self , other : object ) -> bool :
2995
2995
return not self == other
2996
2996
2997
2997
# These properties have to be lazy so that we don't have to load any
@@ -3488,10 +3488,10 @@ def __init__(self, requirement_string: str) -> None:
3488
3488
)
3489
3489
self .__hash = hash (self .hashCmp )
3490
3490
3491
- def __eq__ (self , other : object ):
3491
+ def __eq__ (self , other : object ) -> bool :
3492
3492
return isinstance (other , Requirement ) and self .hashCmp == other .hashCmp
3493
3493
3494
- def __ne__ (self , other ) :
3494
+ def __ne__ (self , other : object ) -> bool :
3495
3495
return not self == other
3496
3496
3497
3497
def __contains__ (
@@ -3513,7 +3513,7 @@ def __contains__(
3513
3513
prereleases = True ,
3514
3514
)
3515
3515
3516
- def __hash__ (self ):
3516
+ def __hash__ (self ) -> int :
3517
3517
return self .__hash
3518
3518
3519
3519
def __repr__ (self ) -> str :
0 commit comments