Datasheet

Using the IronPython Console
19
Working with the –X: Command Line Switches
In addition to the standard command line switches, you also have access to the X: command line
switches, which configure the IronPython interpreter. The following list describes each of the con-
figuration options:
–X:AutoIndent: Enables auto-indenting in the read-evaluation-print loop (REPL).
–X:ColorfulConsole: Enables ColorfulConsole support.
–X:Debug: Enables application debugging. This option is preferred over the –D command
line switch because it’s newer and will enjoy a longer support period.
–X:EnableProfiler: Enables profiling support in the compiler, which helps you optimize
your applications.
–X:ExceptionDetail: Enables ExceptionDetail mode, which gives you more information
about every exception that occurs, making it easier to locate the source of the problem (but
lling the screen much faster as well).
–X:Frames: Enables basic sys._getframe() support.
–X:FullFrames: Enables sys._getframe() with access to local objects and variables.
–X:GCStress: Specifies the garbage collector (GC) stress level. Stressing the GC can point
out potential resource problems in your application.
–X:LightweightScopes: Generates optimized scopes that are easier for the GC to collect.
Optimizing GC functionality tends to improve the overall performance (both speed and
reliability) of your application.
–X:MaxRecursion: Determines the maximum recursion level within the application. Recursion
can use a lot of system resources, so controlling the amount of recursion tends to reduce
resource usage by applications that rely on recursion. Of course, reducing the recursion levels
can also cause application exceptions.
–X:MTA: Runs the application in a multithreaded apartment (MTA).
–X:NoAdaptiveCompilation: Disables the adaptive compilation feature.
–X:PassExceptions: Tells the interpreter not to catch exceptions that are unhandled by
script code.
–X:PrivateBinding: Enables binding to private members.
–X:Python30: Enables available Python 3.0 features, such as classic division (where dividing
two integers produces an integer result).
–X:ShowClrExceptions: Displays the Common Language Specification (CLS) exception
information.
–X:TabCompletion: Enables TabCompletion mode.
–X:Tracing: Enables support for tracing all methods even before the code calls
sys.settrace().
548592c01.indd 19 2/24/10 12:47:14 PM