mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 04:09:05 +00:00
Fix builtin types methods
This commit is contained in:
parent
c56ef64576
commit
8cdc735486
12 changed files with 180 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue