Split std files

This commit is contained in:
Shunsuke Shibayama 2022-11-27 00:26:15 +09:00
parent d38bdd9843
commit 2051692350
8 changed files with 187 additions and 173 deletions

View file

@ -0,0 +1,10 @@
from _erg_result import Error
class Str(str):
def __instancecheck__(cls, obj):
return isinstance(obj, str)
def try_new(s: str): # -> Result[Nat]
if isinstance(s, str):
return Str(s)
else:
return Error("Str can't be other than str")