Python Stepper Restrictions

Stepper is a program to illustrate step-by-step runs of small programs. It uses Python's debugging modules to trace statement execution, variable values, and printed output, which can be helpful for beginners trying to understand how programs behave.

Stepper falls far short of perfection. It has many limitations, which you might find when trying to test a program. Here is a list of the known restrictions and limitations on programs you may try:

  1. Currently, only Python 2.7 is supported.
  2. Only small programs can be tested. If a program would run for more than a few thousand steps, then Stepper will refuse to run the program.
  3. At present, any use of double underscores ("__") is prohibited, with the single exception of constructor methods in classes (so, the __init__ method can be defined).
  4. Any import of modules, or the from statement, is disallowed. Hence, use of common Python libraries such as sys is not allowed. For convenience, three modules are imported automatically: random, math, and something not in the standard Python library, teken for line drawing.
  5. Drawing with teken only works on browsers that support the HTML5 canvas element. Most recent desktop browsers do support this, but some smartphones or other devices do not.
  6. File operations, including read, write, open, and file are not allowed; also, the input and raw_input functions may not be used.
  7. Some dangerous operations such as eval and exec have been removed.
  8. The global statement is not accepted.
In addition to the limitations above, there are some quirks in how Stepper handles certain opertions and data types. The older style formatting operator (%) does not work correctly in some cases -- please use the format method instead, if you need formatting of printed