You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,15 +106,27 @@ and not have to write `a.some_method.bind(a)`
106
106
b.set_callback( a->some_method )
107
107
```
108
108
109
-
. in a function call, as a keyword argument, define callbacks inline with def
109
+
. in a function call, inline functions can be given as keyword arguments
110
110
```
111
-
a.func( callback=def (x,y,z):
112
-
x += y
113
-
return x - z
114
-
111
+
a.func(
112
+
callback1=def (x,y,z):
113
+
x += y
114
+
return x - z,
115
+
callback2= def (x, y):
116
+
return x * y
115
117
)
116
118
```
117
119
120
+
. inline functions can be used inside a dict literal
121
+
```
122
+
a = {
123
+
'cb1' : def (x):
124
+
return x,
125
+
'cb2' : def (y):
126
+
return y
127
+
}
128
+
```
129
+
118
130
Speed
119
131
---------------
120
132
PythonJS gives you the option to optimize your program for speed with a new syntax for static typing, in some cases this results in code that is 20X faster.
0 commit comments