Fix builtin types methods

This commit is contained in:
Shunsuke Shibayama 2023-02-03 00:23:42 +09:00
parent c56ef64576
commit 8cdc735486
12 changed files with 180 additions and 7 deletions

View file

@ -1,5 +1,7 @@
from _erg_int import Int
from _erg_nat import Nat
from _erg_float import Float
from _erg_str import Str
def int__(i):
try:
@ -12,3 +14,15 @@ def nat__(i):
return Nat(i)
except:
return None
def float__(f):
try:
return Float(f)
except:
return None
def str__(s):
try:
return Str(s)
except:
return None