Skip to content

Commit 3cf1619

Browse files
committed
#223-remove Pylance warnings
Completed. Fully validated.
1 parent b8db6b4 commit 3cf1619

File tree

18 files changed

+44
-44
lines changed

18 files changed

+44
-44
lines changed

Python3.10/PyRandLib/basecwg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class BaseCWG( BaseRandom ):
8282
"""
8383

8484
#-------------------------------------------------------------------------
85-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
85+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
8686
"""Constructor.
8787
8888
Should _seedState be None then the local time is used as a seed (with
@@ -107,7 +107,7 @@ def getstate(self) -> StatesListAndExt:
107107
108108
All inheriting classes MUST IMPLEMENT this method.
109109
"""
110-
return (self._a, self._weyl, self._s, self._state)
110+
return (self._a, self._weyl, self._s, self._state) # type: ignore
111111

112112

113113
#===== end of module basecwg.py ========================================

Python3.10/PyRandLib/cwg64.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ class Cwg64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64)
89+
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64
96+
_OUT_BITS: Final[int] = 64 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.
100100
"""
101101

102102

103103
#-------------------------------------------------------------------------
104-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
104+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
105105
"""Constructor.
106106
107107
Should _seedState be None then the local time is used as a seed (with
@@ -124,7 +124,7 @@ def next(self) -> int:
124124

125125

126126
#-------------------------------------------------------------------------
127-
def seed(self, _seed: Numerical = None, /) -> None:
127+
def seed(self, _seed: Numerical = None, /) -> None: # type: ignore
128128
"""Initiates the internal state of this pseudo-random generator.
129129
"""
130130
if _seed is None or isinstance(_seed, (int, float)):
@@ -140,7 +140,7 @@ def seed(self, _seed: Numerical = None, /) -> None:
140140

141141

142142
#-------------------------------------------------------------------------
143-
def setstate(self, _state: StateType = None, /) -> None:
143+
def setstate(self, _state: StateType = None, /) -> None: # type: ignore
144144
"""Restores the internal state of the generator.
145145
146146
_state should have been obtained from a previous call

Python3.10/PyRandLib/squares64.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Squares64( BaseSquares ):
9191

9292

9393
#-------------------------------------------------------------------------
94-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
94+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
9595
"""Constructor.
9696
9797
Should _seedState be None then the local time is used as a seed (with

Python3.11/PyRandLib/basecwg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class BaseCWG( BaseRandom ):
8282
"""
8383

8484
#-------------------------------------------------------------------------
85-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
85+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
8686
"""Constructor.
8787
8888
Should _seedState be None then the local time is used as a seed (with
@@ -107,7 +107,7 @@ def getstate(self) -> StatesListAndExt:
107107
108108
All inheriting classes MUST IMPLEMENT this method.
109109
"""
110-
return (self._a, self._weyl, self._s, self._state)
110+
return (self._a, self._weyl, self._s, self._state) # type: ignore
111111

112112

113113
#===== end of module basecwg.py ========================================

Python3.11/PyRandLib/cwg64.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ class Cwg64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64)
89+
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64
96+
_OUT_BITS: Final[int] = 64 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.
100100
"""
101101

102102

103103
#-------------------------------------------------------------------------
104-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
104+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
105105
"""Constructor.
106106
107107
Should _seedState be None then the local time is used as a seed (with
@@ -124,7 +124,7 @@ def next(self) -> int:
124124

125125

126126
#-------------------------------------------------------------------------
127-
def seed(self, _seed: Numerical = None, /) -> None:
127+
def seed(self, _seed: Numerical = None, /) -> None: # type: ignore
128128
"""Initiates the internal state of this pseudo-random generator.
129129
"""
130130
if _seed is None or isinstance(_seed, (int, float)):
@@ -140,7 +140,7 @@ def seed(self, _seed: Numerical = None, /) -> None:
140140

141141

142142
#-------------------------------------------------------------------------
143-
def setstate(self, _state: StateType = None, /) -> None:
143+
def setstate(self, _state: StateType = None, /) -> None: # type: ignore
144144
"""Restores the internal state of the generator.
145145
146146
_state should have been obtained from a previous call

Python3.11/PyRandLib/squares64.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class Squares64( BaseSquares ):
9191

9292

9393
#-------------------------------------------------------------------------
94-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
94+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
9595
"""Constructor.
9696
9797
Should _seedState be None then the local time is used as a seed (with

Python3.12/PyRandLib/basecwg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class BaseCWG( BaseRandom ):
8484
"""
8585

8686
#-------------------------------------------------------------------------
87-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
87+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
8888
"""Constructor.
8989
9090
Should _seedState be None then the local time is used as a seed (with
@@ -110,7 +110,7 @@ def getstate(self) -> StatesListAndExt:
110110
111111
All inheriting classes MUST IMPLEMENT this method.
112112
"""
113-
return (self._a, self._weyl, self._s, self._state)
113+
return (self._a, self._weyl, self._s, self._state) # type: ignore
114114

115115

116116
#===== end of module basecwg.py ========================================

Python3.12/PyRandLib/cwg64.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ class Cwg64( BaseCWG ):
8686

8787

8888
#-------------------------------------------------------------------------
89-
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64)
89+
_NORMALIZE: Final[float] = 5.421_010_862_427_522_170_037_3e-20 # i.e. 1.0 / (1 << 64) # type: ignore
9090
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9191
classes if returned random integer values are coded on anything else
9292
than 32 bits. It is THE multiplier constant value to be applied to
9393
pseudo-random number for them to be normalized in interval [0.0, 1.0).
9494
"""
9595

96-
_OUT_BITS: Final[int] = 64
96+
_OUT_BITS: Final[int] = 64 # type: ignore
9797
"""The value of this class attribute MUST BE OVERRIDDEN in inheriting
9898
classes if returned random integer values are coded on anything else
9999
than 32 bits.
100100
"""
101101

102102

103103
#-------------------------------------------------------------------------
104-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
104+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
105105
"""Constructor.
106106
107107
Should _seedState be None then the local time is used as a seed (with
@@ -126,7 +126,7 @@ def next(self) -> int:
126126

127127
#-------------------------------------------------------------------------
128128
@override
129-
def seed(self, _seed: Numerical = None, /) -> None:
129+
def seed(self, _seed: Numerical = None, /) -> None: # type: ignore
130130
"""Initiates the internal state of this pseudo-random generator.
131131
"""
132132
if _seed is None or isinstance(_seed, (int, float)):
@@ -143,7 +143,7 @@ def seed(self, _seed: Numerical = None, /) -> None:
143143

144144
#-------------------------------------------------------------------------
145145
@override
146-
def setstate(self, _state: StateType = None, /) -> None:
146+
def setstate(self, _state: StateType = None, /) -> None: # type: ignore
147147
"""Restores the internal state of the generator.
148148
149149
_state should have been obtained from a previous call

Python3.12/PyRandLib/squares64.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Squares64( BaseSquares ):
9393

9494

9595
#-------------------------------------------------------------------------
96-
def __init__(self, _seedState: SeedStateType = None, /) -> None:
96+
def __init__(self, _seedState: SeedStateType = None, /) -> None: # type: ignore
9797
"""Constructor.
9898
9999
Should _seedState be None then the local time is used as a seed (with

Python3.12/unit_tests/test_splitmix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def test_not_none(self):
222222
with pytest.raises(TypeError):
223223
splt = SplitMix32((1, 2)) # type: ignore
224224
with pytest.raises(TypeError):
225-
splt = SpliSplitMix32tMix63([1, 2]) # type: ignore
225+
splt = SplitMix32([1, 2]) # type: ignore
226226
with pytest.raises(TypeError):
227227
splt = SplitMix32("123") # type: ignore
228228
with pytest.raises(TypeError):

0 commit comments

Comments
 (0)