Skip to content

Commit 0926faf

Browse files
committed
[GR-13120] Cleanup Python options and revisit their categories.
PullRequest: graalpython/339
2 parents c3d3b06 + e951742 commit 0926faf

File tree

2 files changed

+49
-49
lines changed

2 files changed

+49
-49
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ protected void printHelp(OptionCategory maxCategory) {
363363
"-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n" +
364364
"-c cmd : program passed in as string (terminates option list)\n" +
365365
// "-d : debug output from parser; also PYTHONDEBUG=x\n" +
366-
// "-E : ignore PYTHON* environment variables (such as PYTHONPATH)\n" +
366+
"-E : ignore PYTHON* environment variables (such as PYTHONPATH)\n" +
367367
"-h : print this help message and exit (also --help)\n" +
368368
"-i : inspect interactively after running script; forces a prompt even\n" +
369369
" if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n" +

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonOptions.java

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,6 @@ private PythonOptions() {
4040
// no instances
4141
}
4242

43-
@Option(category = OptionCategory.DEBUG, help = "Expose internal sources as normal sources, so they will show up in the debugger and stacks") //
44-
public static final OptionKey<Boolean> ExposeInternalSources = new OptionKey<>(false);
45-
46-
@Option(category = OptionCategory.DEBUG, help = "Print the java stacktrace if enabled") //
47-
public static final OptionKey<Boolean> WithJavaStacktrace = new OptionKey<>(false);
48-
49-
@Option(category = OptionCategory.DEBUG, help = "") //
50-
public static final OptionKey<Boolean> IntrinsifyBuiltinCalls = new OptionKey<>(true);
51-
52-
@Option(category = OptionCategory.DEBUG, help = "") //
53-
public static final OptionKey<Integer> AttributeAccessInlineCacheMaxDepth = new OptionKey<>(3);
54-
55-
@Option(category = OptionCategory.DEBUG, help = "") //
56-
public static final OptionKey<Integer> CallSiteInlineCacheMaxDepth = new OptionKey<>(3);
57-
58-
@Option(category = OptionCategory.DEBUG, help = "") //
59-
public static final OptionKey<Integer> VariableArgumentReadUnrollingLimit = new OptionKey<>(5);
60-
61-
@Option(category = OptionCategory.DEBUG, help = "") //
62-
public static final OptionKey<Integer> VariableArgumentInlineCacheLimit = new OptionKey<>(3);
63-
64-
@Option(category = OptionCategory.DEBUG, help = "") //
65-
public static final OptionKey<Boolean> ForceInlineGeneratorCalls = new OptionKey<>(false);
66-
67-
@Option(category = OptionCategory.DEBUG, help = "") //
68-
public static final OptionKey<Boolean> CatchGraalPythonExceptionForUnitTesting = new OptionKey<>(false);
69-
70-
@Option(category = OptionCategory.DEBUG, help = "") //
71-
public static final OptionKey<Boolean> CatchAllExceptions = new OptionKey<>(false);
72-
7343
@Option(category = OptionCategory.USER, help = "Set the location of sys.prefix. Overrides any environment variables or Java options.") //
7444
public static final OptionKey<String> SysPrefix = new OptionKey<>("");
7545

@@ -79,53 +49,83 @@ private PythonOptions() {
7949
@Option(category = OptionCategory.USER, help = "Set the location of lib-python/3. Overrides any environment variables or Java options.") //
8050
public static final OptionKey<String> StdLibHome = new OptionKey<>("");
8151

82-
@Option(category = OptionCategory.EXPERT, help = "This option is set by the Python launcher to tell the language it can print exceptions directly") //
83-
public static final OptionKey<Boolean> AlwaysRunExcepthook = new OptionKey<>(false);
84-
85-
@Option(category = OptionCategory.EXPERT, help = "This option control builtin _thread module support") //
86-
public static final OptionKey<Boolean> WithThread = new OptionKey<>(false);
87-
8852
@Option(category = OptionCategory.USER, help = "This option makes reading from files return opaque objects. Imports can work with such data, " +
8953
"but all other access to the contents of the file is disabled, so the files are kept secret.") //
9054
public static final OptionKey<Boolean> OpaqueFilesystem = new OptionKey<>(false);
9155

92-
@Option(category = OptionCategory.USER, help = "") //
56+
@Option(category = OptionCategory.USER, help = "Equivalent to the Python -i flag. Inspect interactively after running a script.") //
9357
public static final OptionKey<Boolean> InspectFlag = new OptionKey<>(false);
9458

95-
@Option(category = OptionCategory.USER, help = "") //
59+
@Option(category = OptionCategory.USER, help = "Equivalent to the Python -q flag. Don't print version and copyright messages on interactive startup.") //
9660
public static final OptionKey<Boolean> QuietFlag = new OptionKey<>(false);
9761

98-
@Option(category = OptionCategory.USER, help = "") //
62+
@Option(category = OptionCategory.USER, help = "Equivalent to the Python -S flag. Don't imply 'import site' on initialization.") //
9963
public static final OptionKey<Boolean> NoSiteFlag = new OptionKey<>(false);
10064

101-
@Option(category = OptionCategory.USER, help = "") //
65+
@Option(category = OptionCategory.USER, help = "Equivalent to the Python -s flag. Don't add user site directory to sys.path.") //
10266
public static final OptionKey<Boolean> NoUserSiteFlag = new OptionKey<>(false);
10367

104-
@Option(category = OptionCategory.USER, help = "") //
68+
@Option(category = OptionCategory.USER, help = "Equivalent to setting the PYTHONPATH environment variable for the standard launcher. ':'-separated list of directories prefixed to the default module search path.") //
10569
public static final OptionKey<String> PythonPath = new OptionKey<>("");
10670

10771
@Option(category = OptionCategory.USER, help = "Remove assert statements and any code conditional on the value of __debug__.") //
10872
public static final OptionKey<Boolean> PythonOptimizeFlag = new OptionKey<>(false);
10973

110-
@Option(category = OptionCategory.DEBUG, help = "Turn on verbose mode") //
74+
@Option(category = OptionCategory.USER, help = "Equivalent to the Python -v flag. Turn on verbose mode.") //
11175
public static final OptionKey<Boolean> VerboseFlag = new OptionKey<>(false);
11276

113-
@Option(category = OptionCategory.EXPERT, help = "Switch on/off using lazy strings for performance reasons. Default true.") //
114-
public static final OptionKey<Boolean> LazyStrings = new OptionKey<>(true);
77+
@Option(category = OptionCategory.DEBUG, help = "Expose internal sources as normal sources, so they will show up in the debugger and stacks") //
78+
public static final OptionKey<Boolean> ExposeInternalSources = new OptionKey<>(false);
79+
80+
@Option(category = OptionCategory.DEBUG, help = "Print the java stacktrace if enabled") //
81+
public static final OptionKey<Boolean> WithJavaStacktrace = new OptionKey<>(false);
82+
83+
@Option(category = OptionCategory.DEBUG, help = "") //
84+
public static final OptionKey<Boolean> CatchGraalPythonExceptionForUnitTesting = new OptionKey<>(false);
85+
86+
@Option(category = OptionCategory.DEBUG, help = "Enable catching all Exceptions in generic try-catch statements.") //
87+
public static final OptionKey<Boolean> CatchAllExceptions = new OptionKey<>(false);
88+
89+
@Option(category = OptionCategory.EXPERT, help = "") //
90+
public static final OptionKey<Boolean> IntrinsifyBuiltinCalls = new OptionKey<>(true);
91+
92+
@Option(category = OptionCategory.EXPERT, help = "") //
93+
public static final OptionKey<Integer> AttributeAccessInlineCacheMaxDepth = new OptionKey<>(3);
11594

116-
@Option(category = OptionCategory.DEBUG, help = "Minimal size of string, when lazy strings are used. Default 20") //
95+
@Option(category = OptionCategory.EXPERT, help = "") //
96+
public static final OptionKey<Integer> CallSiteInlineCacheMaxDepth = new OptionKey<>(3);
97+
98+
@Option(category = OptionCategory.EXPERT, help = "") //
99+
public static final OptionKey<Integer> VariableArgumentReadUnrollingLimit = new OptionKey<>(5);
100+
101+
@Option(category = OptionCategory.EXPERT, help = "") //
102+
public static final OptionKey<Integer> VariableArgumentInlineCacheLimit = new OptionKey<>(3);
103+
104+
@Option(category = OptionCategory.EXPERT, help = "") //
105+
public static final OptionKey<Boolean> ForceInlineGeneratorCalls = new OptionKey<>(false);
106+
107+
@Option(category = OptionCategory.EXPERT, help = "Minimal size of string, when lazy strings are used. Default 20") //
117108
public static final OptionKey<Integer> MinLazyStringLength = new OptionKey<>(20);
118109

110+
@Option(category = OptionCategory.EXPERT, help = "This option is set by the Python launcher to tell the language it can print exceptions directly") //
111+
public static final OptionKey<Boolean> AlwaysRunExcepthook = new OptionKey<>(false);
112+
113+
@Option(category = OptionCategory.EXPERT, help = "This option control builtin _thread module support") //
114+
public static final OptionKey<Boolean> WithThread = new OptionKey<>(false);
115+
116+
@Option(category = OptionCategory.EXPERT, help = "Switch on/off using lazy strings for performance reasons. Default true.") //
117+
public static final OptionKey<Boolean> LazyStrings = new OptionKey<>(true);
118+
119119
@Option(category = OptionCategory.EXPERT, help = "Enable forced splitting (of builtins). Default true.") //
120120
public static final OptionKey<Boolean> EnableForcedSplits = new OptionKey<>(true);
121121

122-
@Option(category = OptionCategory.EXPERT, help = "") //
122+
@Option(category = OptionCategory.EXPERT, help = "Set by the launcher if an interactive console is used to run Python.") //
123123
public static final OptionKey<Boolean> TerminalIsInteractive = new OptionKey<>(false);
124124

125-
@Option(category = OptionCategory.EXPERT, help = "") //
125+
@Option(category = OptionCategory.EXPERT, help = "Set by the launcher to the terminal width.") //
126126
public static final OptionKey<Integer> TerminalWidth = new OptionKey<>(80);
127127

128-
@Option(category = OptionCategory.EXPERT, help = "") //
128+
@Option(category = OptionCategory.EXPERT, help = "Set by the launcher to the terminal height.") //
129129
public static final OptionKey<Integer> TerminalHeight = new OptionKey<>(25);
130130

131131
public static OptionDescriptors createDescriptors() {

0 commit comments

Comments
 (0)