Kaydet (Commit) f6c6d1e2 authored tarafından Zachary Ware's avatar Zachary Ware Kaydeden (comit) GitHub

bpo-11681: Document the `-b` and `-bb` options (GH-1562)

üst 4be66b6c
...@@ -24,7 +24,7 @@ Command line ...@@ -24,7 +24,7 @@ Command line
When invoking Python, you may specify any of these options:: When invoking Python, you may specify any of these options::
python [-BdEiOQsRStuUvVWxX3?] [-c command | -m module-name | script | - ] [args] python [-bBdEiOQsRStuUvVWxX3?] [-c command | -m module-name | script | - ] [args]
The most common use case is, of course, a simple invocation of a script:: The most common use case is, of course, a simple invocation of a script::
...@@ -191,6 +191,19 @@ Generic options ...@@ -191,6 +191,19 @@ Generic options
Miscellaneous options Miscellaneous options
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
.. cmdoption:: -b
Issue a warning when comparing :class:`unicode` with :class:`bytearray`.
Issue an error when the option is given twice (:option:`!-bb`).
Note that, unlike the corresponding Python 3.x flag, this will **not** emit
warnings for comparisons between :class:`str` and :class:`unicode`.
Instead, the ``str`` instance will be implicitly decoded to ``unicode`` and
Unicode comparison used.
.. versionadded:: 2.6
.. cmdoption:: -B .. cmdoption:: -B
If given, Python won't try to write ``.pyc`` or ``.pyo`` files on the If given, Python won't try to write ``.pyc`` or ``.pyo`` files on the
......
...@@ -62,6 +62,8 @@ static char *usage_line = ...@@ -62,6 +62,8 @@ static char *usage_line =
/* Long usage message, split into parts < 512 bytes */ /* Long usage message, split into parts < 512 bytes */
static char *usage_1 = "\ static char *usage_1 = "\
Options and arguments (and corresponding environment variables):\n\ Options and arguments (and corresponding environment variables):\n\
-b : issue warnings about comparing bytearray with unicode\n\
(-bb: issue errors)\n\
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n\ -B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n\
-c cmd : program passed in as string (terminates option list)\n\ -c cmd : program passed in as string (terminates option list)\n\
-d : debug output from parser; also PYTHONDEBUG=x\n\ -d : debug output from parser; also PYTHONDEBUG=x\n\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment