mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
feat(els): support module renaming
This commit is contained in:
parent
38f34edbf0
commit
f3fd5e3eeb
13 changed files with 222 additions and 39 deletions
|
@ -6,13 +6,13 @@ class Error:
|
|||
|
||||
# T = TypeVar("T")
|
||||
# @_SpecialForm
|
||||
def Result(self, parameters):
|
||||
"""Result type.
|
||||
|
||||
Result[T] is equivalent to Union[T, Error].
|
||||
"""
|
||||
# arg = _type_check(parameters, f"{self} requires a single type.")
|
||||
return [arg, Error]
|
||||
# def Result(self, parameters):
|
||||
# """Result type.
|
||||
#
|
||||
# Result[T] is equivalent to Union[T, Error].
|
||||
# """
|
||||
# arg = _type_check(parameters, f"{self} requires a single type.")
|
||||
# return [arg, Error]
|
||||
|
||||
def is_ok(obj) -> bool:
|
||||
return not isinstance(obj, Error)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from _erg_range import Range, LeftOpenRange, RightOpenRange, OpenRange, ClosedRange, RangeIterator
|
||||
from _erg_result import Result, Error, is_ok
|
||||
from _erg_result import Error, is_ok
|
||||
from _erg_float import Float, FloatMut
|
||||
from _erg_int import Int, IntMut
|
||||
from _erg_nat import Nat, NatMut
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue