General Notes on Syntax
Keywords
Keywords
The following words are reserved by Scenic and cannot be used as identifiers (i.e. as names of variables, functions, classes, properties, etc.).
False break except lambda require
None by finally new return
True class for nonlocal to
and continue from not try
as def global of until
assert del if on while
async do import or with
at elif in pass yield
await else is raise
Soft Keywords
The following words have special meanings in Scenic in certain contexts, but are still available for use as identifiers. Users should take care not to use these names when doing so would introduce ambiguity. For example, consider the following code:
distance = 5 # not a good variable name to use here
new Object beyond A by distance from B
This might appear to use the three-argument form of the beyond specifier, creating the new object at distance 5 beyond A from the point of view of B.
But in fact Scenic parses the code as beyond A by (distance from B), because the interpretation of distance as being part of the distance from operator takes precedence.
To avoid confusion, we recommend not using distance, angle, offset, altitude, or visible as identifiers in code that uses Scenic operators or specifiers (inside pure-Python helper functions is fine).
_ below final mutate setup
abort beyond follow next shuffle
above bottom following not simulation
additive can from of simulator
after case front offset steps
ahead choose heading override take
along compose implies param terminate
altitude contained initial past top
always deg interrupt position toward
angle directly intersects precondition type
apparent distance invariant record visible
apparently dynamic left relative wait
away ego match right when
back eventually minimum scenario workspace
behavior every model seconds
behind facing monitor see
Builtin Names
The following names are built into Scenic and can be used but not overwritten .
float globalParameters int str