|
9 | 9 | from fractions import Fraction |
10 | 10 | from functools import partial, reduce |
11 | 11 | from types import FunctionType, MethodType |
12 | | -from typing import TYPE_CHECKING, Generic, Protocol, TypeAlias, TypeVar, Union, cast, overload |
| 12 | +from typing import TYPE_CHECKING, Generic, Protocol, TypeAlias, TypeVar, cast, overload |
13 | 13 |
|
14 | 14 | from typing_extensions import TypeVarTuple, Unpack |
15 | 15 |
|
@@ -101,8 +101,6 @@ def join(*strings: StringLike) -> String: ... |
101 | 101 |
|
102 | 102 | converter(str, String, String) |
103 | 103 |
|
104 | | -BoolLike: TypeAlias = Union["Bool", bool] |
105 | | - |
106 | 104 |
|
107 | 105 | class Bool(BuiltinExpr, egg_sort="bool"): |
108 | 106 | @method(preserve=True) |
@@ -133,10 +131,10 @@ def __xor__(self, other: BoolLike) -> Bool: ... |
133 | 131 | def implies(self, other: BoolLike) -> Bool: ... |
134 | 132 |
|
135 | 133 |
|
136 | | -converter(bool, Bool, Bool) |
| 134 | +BoolLike: TypeAlias = Bool | bool |
137 | 135 |
|
138 | | -# The types which can be convertered into an i64 |
139 | | -i64Like: TypeAlias = Union["i64", int] # noqa: N816, PYI042 |
| 136 | + |
| 137 | +converter(bool, Bool, Bool) |
140 | 138 |
|
141 | 139 |
|
142 | 140 | class i64(BuiltinExpr): # noqa: N801 |
@@ -248,16 +246,16 @@ def bool_le(self, other: i64Like) -> Bool: ... |
248 | 246 | def bool_ge(self, other: i64Like) -> Bool: ... |
249 | 247 |
|
250 | 248 |
|
| 249 | +# The types which can be convertered into an i64 |
| 250 | +i64Like: TypeAlias = i64 | int # noqa: N816, PYI042 |
| 251 | + |
251 | 252 | converter(int, i64, i64) |
252 | 253 |
|
253 | 254 |
|
254 | 255 | @function(builtin=True, egg_fn="count-matches") |
255 | 256 | def count_matches(s: StringLike, pattern: StringLike) -> i64: ... |
256 | 257 |
|
257 | 258 |
|
258 | | -f64Like: TypeAlias = Union["f64", float] # noqa: N816, PYI042 |
259 | | - |
260 | | - |
261 | 259 | class f64(BuiltinExpr): # noqa: N801 |
262 | 260 | @method(preserve=True) |
263 | 261 | def eval(self) -> float: |
@@ -337,6 +335,9 @@ def from_i64(cls, i: i64) -> f64: ... |
337 | 335 | def to_string(self) -> String: ... |
338 | 336 |
|
339 | 337 |
|
| 338 | +f64Like: TypeAlias = f64 | float # noqa: N816, PYI042 |
| 339 | + |
| 340 | + |
340 | 341 | converter(float, f64, f64) |
341 | 342 |
|
342 | 343 |
|
|
0 commit comments