|
4.27.2 pyobject expressions
A pyobject expression is (optional parts in square brackets):
-
an identifier of type pyobject
-
a function returning pyobject
-
pyobject expressions combined by the arithmetic operations
+ , - , * , / , or ^ , and the member-of
operators . and ::
-
an list expression with elements made of pyobject expressions
(see Type conversion and casting)
-
an string expression (see Type conversion and casting)
-
an int expression (see Type conversion and casting)
Example:
| pyobject pystr = "python string ";
pystr;
==> 'python string '
pyobject pyint = 2;
pyint;
==> 2
pyobject pylst = list(pystr, pyint);
pylst;
==> ['python string ', 2]
pyint + pyint;
==> 4
pyint * pyint;
==> 4
pystr + pystr;
==> 'python string python string '
pystr * pyint;
==> 'python string python string '
python_eval("17 + 4");
==> 21
typeof(_);
==> pyobject
|
|