Remove unnecessary Optional
The type hints `object` and `Optional[object]` both allow the default value `None`. Also, this commit gets rid of ruff's "FA100" error for the two changed lines.
This commit is contained in:
parent
81912f1a81
commit
6ddb545491
1 changed files with 3 additions and 5 deletions
|
@ -32,9 +32,7 @@ import abc
|
||||||
import functools
|
import functools
|
||||||
import math
|
import math
|
||||||
import numbers
|
import numbers
|
||||||
|
from typing import Callable, ClassVar, Literal
|
||||||
# When giving up support for Python 3.9, we can get rid of `Optional`
|
|
||||||
from typing import Callable, ClassVar, Literal, Optional
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -502,7 +500,7 @@ class GF2Element(metaclass=GF2Meta):
|
||||||
"""
|
"""
|
||||||
return self._compute(other, lambda s, o: o % s)
|
return self._compute(other, lambda s, o: o % s)
|
||||||
|
|
||||||
def __pow__(self, other: object, _modulo: Optional[object] = None) -> Self:
|
def __pow__(self, other: object, _modulo: object = None) -> Self:
|
||||||
"""Exponentiation: `self ** other`.
|
"""Exponentiation: `self ** other`.
|
||||||
|
|
||||||
Powers of `gf2` values are like powers of `int`s.
|
Powers of `gf2` values are like powers of `int`s.
|
||||||
|
@ -520,7 +518,7 @@ class GF2Element(metaclass=GF2Meta):
|
||||||
"""
|
"""
|
||||||
return self._compute(other, lambda s, o: s**o)
|
return self._compute(other, lambda s, o: s**o)
|
||||||
|
|
||||||
def __rpow__(self, other: object, _modulo: Optional[object] = None) -> Self:
|
def __rpow__(self, other: object, _modulo: object = None) -> Self:
|
||||||
"""(Reflected) Exponentiation: `other ** self`.
|
"""(Reflected) Exponentiation: `other ** self`.
|
||||||
|
|
||||||
See docstring for `.__pow__()`.
|
See docstring for `.__pow__()`.
|
||||||
|
|
Loading…
Reference in a new issue