FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/tests/parser/lambda1.py at main · ctbinzi/lpython · GitHub
ctbinzi
/
lpython
Public
forked from
lcompilers/lpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
tests
/
parser
/
lambda1.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (44 loc) · 1.79 KB
Breadcrumbs
lpython
/
tests
/
parser
/
lambda1.py
Copy path
File metadata and controls
59 lines (44 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# AST tests only
if
x
is
0
:
x
=
lambda
a
:
'``{a}```'
else
:
y
=
lambda
b
,
c
:
x
(
a
)
x
=
sorted
(
x
,
key
=
lambda
f
:
f
[
0
])
add
=
lambda
x
,
y
:
np
.
add
(
x
,
y
)
%
5
var
.
sort
(
key
=
lambda
x
:
x
[
2
])
def
__lt__
(
self
,
other
):
return
self
.
_compare
(
other
,
lambda
s
,
o
:
s
<
o
)
def
formatargspec
(
args
,
varargs
=
0
,
varkw
=
0
,
defaults
=
0
,
formatarg
=
str
,
formatvarargs
=
lambda
name
:
'*'
+
name
,
formatvarkw
=
lambda
name
:
'**'
+
name
,
formatvalue
=
lambda
value
:
'='
+
repr
(
value
),
join
=
joinseq
):
pass
def
__init__
(
self
,
float_conv
=
float
,
int_conv
=
int
,
float_to_float
=
float
,
float_to_str
=
lambda
v
:
'%24.16e'
%
v
,
title
=
'Python floating point numbe'
):
pass
def
test_deprecated
(
self
,
func
):
self
.
assert_deprecated
(
lambda
:
func
([
0.
,
1.
],
0.
,
interpolation
=
"linear"
))
self
.
assert_deprecated
(
lambda
:
func
([
0.
,
1.
],
0.
,
interpolation
=
"nearest"
))
def
indirect
(
x
):
return
lambda
:
x
def
_discovered_machar
(
ftype
):
params
=
_MACHAR_PARAMS
[
ftype
]
return
MachAr
(
lambda
v
:
array
([
v
],
ftype
),
lambda
v
:
_fr0
(
v
.
astype
(
params
[
'itype'
]))[
0
],
lambda
v
:
array
(
_fr0
(
v
)[
0
],
ftype
),
lambda
v
:
params
[
'fmt'
]
%
array
(
_fr0
(
v
)[
0
],
ftype
),
params
[
'title'
])
assert_raises
(
IndexError
,
lambda
:
a
[:
4
])
assert_equal
(
np
.
array2string
(
x
,
formatter
=
{
'int'
:
lambda
x
:
oct
(
x
)}),
x_oct
)
assert_equal
(
np
.
array2string
(
a
,
separator
=
', '
,
formatter
=
{
'datetime'
:
lambda
x
:
"'%s'"
%
np
.
datetime_as_string
(
x
,
timezone
=
'UTC'
)}),
"['2011-03-16T13:55Z', '1920-01-01T03:12Z']"
)
assert_raises_fpe
(
'underflow'
,
lambda
a
,
b
:
a
/
b
,
sy16
,
by16
)
MyArr
=
type
(
"MyArr"
, {
protocol
:
getattr
(
blueprint
,
protocol
),
"__float__"
:
lambda
_
:
0.5
})
Back
|
FazBrowse Home
|
New Git URL