File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Command line
24
24
25
25
When invoking Python, you may specify any of these options::
26
26
27
- python [-BdEiOQsRStuUvVWxX3 ?] [-c command | -m module-name | script | - ] [args]
27
+ python [-bBdEiOQsRStuUvVWxX3 ?] [-c command | -m module-name | script | - ] [args]
28
28
29
29
The most common use case is, of course, a simple invocation of a script::
30
30
@@ -191,6 +191,19 @@ Generic options
191
191
Miscellaneous options
192
192
~~~~~~~~~~~~~~~~~~~~~
193
193
194
+ .. cmdoption :: -b
195
+
196
+ Issue a warning when comparing :class: `unicode ` with :class: `bytearray `.
197
+ Issue an error when the option is given twice (:option: `!-bb `).
198
+
199
+ Note that, unlike the corresponding Python 3.x flag, this will **not ** emit
200
+ warnings for comparisons between :class: `str ` and :class: `unicode `.
201
+ Instead, the ``str `` instance will be implicitly decoded to ``unicode `` and
202
+ Unicode comparison used.
203
+
204
+ .. versionadded :: 2.6
205
+
206
+
194
207
.. cmdoption :: -B
195
208
196
209
If given, Python won't try to write ``.pyc `` or ``.pyo `` files on the
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ static char *usage_line =
62
62
/* Long usage message, split into parts < 512 bytes */
63
63
static char * usage_1 = "\
64
64
Options and arguments (and corresponding environment variables):\n\
65
+ -b : issue warnings about comparing bytearray with unicode\n\
66
+ (-bb: issue errors)\n\
65
67
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n\
66
68
-c cmd : program passed in as string (terminates option list)\n\
67
69
-d : debug output from parser; also PYTHONDEBUG=x\n\
You can’t perform that action at this time.
0 commit comments