diff options
Diffstat (limited to 'Misc/python.man')
-rw-r--r-- | Misc/python.man | 77 |
1 files changed, 32 insertions, 45 deletions
diff --git a/Misc/python.man b/Misc/python.man index 20beded362..bcb3ec8723 100644 --- a/Misc/python.man +++ b/Misc/python.man @@ -11,6 +11,9 @@ python \- an interpreted, interactive, object-oriented programming language .B \-B ] [ +.B \-b +] +[ .B \-d ] [ @@ -23,25 +26,18 @@ python \- an interpreted, interactive, object-oriented programming language .B \-i ] [ -.B \-m +.B \-m .I module-name ] -[ -.B \-q -] .br [ -.B \-O -] -[ -.B \-OO +.B \-q ] [ -.B \-R +.B \-O ] [ -.B -Q -.I argument +.B \-OO ] [ .B \-s @@ -67,6 +63,10 @@ python \- an interpreted, interactive, object-oriented programming language .B \-x ] [ +[ +.B \-X +.I option +] .B \-? ] .br @@ -112,6 +112,10 @@ Don't write .I .py[co] files on import. See also PYTHONDONTWRITEBYTECODE. .TP +.B \-b +Issue warnings about str(bytes_instance), str(bytearray_instance) +and comparing bytes/bytearray with str. (-bb: issue errors) +.TP .BI "\-c " command Specify the command to execute (see next section). This terminates the option list (following options are passed as @@ -155,27 +159,6 @@ Discard docstrings in addition to the \fB-O\fP optimizations. Do not print the version and copyright messages. These messages are also suppressed in non-interactive mode. .TP -.B \-R -Turn on "hash randomization", so that the hash() values of str, bytes and -datetime objects are "salted" with an unpredictable pseudo-random value. -Although they remain constant within an individual Python process, they are -not predictable between repeated invocations of Python. -.IP -This is intended to provide protection against a denial of service -caused by carefully-chosen inputs that exploit the worst case performance -of a dict construction, O(n^2) complexity. See -http://www.ocert.org/advisories/ocert-2011-003.html -for details. -.TP -.BI "\-Q " argument -Division control; see PEP 238. The argument must be one of "old" (the -default, int/int and long/long return an int or long), "new" (new -division semantics, i.e. int/int and long/long returns a float), -"warn" (old division semantics with a warning for int/int and -long/long), or "warnall" (old division semantics with a warning for -all use of the division operator). For a use of "warnall", see the -Tools/scripts/fixdiv.py script. -.TP .B \-s Don't add user site directory to sys.path. .TP @@ -184,10 +167,13 @@ Disable the import of the module .I site and the site-dependent manipulations of .I sys.path -that it entails. +that it entails. Also disable these manipulations if +.I site +is explicitly imported later. .TP .B \-u -Force the binary I/O layers of stdin, stdout and stderr to be unbuffered. +Force the binary I/O layers of stdout and stderr to be unbuffered. +stdin is always buffered. The text I/O layer will still be line-buffered. .\" Note that there is internal buffering in readlines() and .\" file-object iterators ("for line in sys.stdin") which is not @@ -269,6 +255,9 @@ case-sensitive. The field matches the line number, where zero matches all line numbers and is thus equivalent to an omitted line number. .TP +.BI "\-X " option +Set implementation specific option. +.TP .B \-x Skip the first line of the source. This is intended for a DOS specific hack only. Warning: the line numbers in error messages will @@ -283,9 +272,9 @@ executes a from that file; when called with .B \-c -.I command, +.IR command , it executes the Python statement(s) given as -.I command. +.IR command . Here .I command may contain multiple statements separated by newlines. @@ -295,7 +284,7 @@ executed. .PP If available, the script name and additional arguments thereafter are passed to the script in the Python variable -.I sys.argv , +.IR sys.argv , which is a list of strings (you must first .I import sys to be able to access it). @@ -309,14 +298,14 @@ contains the string .I '-c'. Note that options interpreted by the Python interpreter itself are not placed in -.I sys.argv. +.IR sys.argv . .PP In interactive mode, the primary prompt is `>>>'; the second prompt (which appears when a command is not complete) is `...'. The prompts can be changed by assignment to .I sys.ps1 or -.I sys.ps2. +.IR sys.ps2 . The interpreter quits when it reads an EOF at a prompt. When an unhandled exception occurs, a stack trace is printed and control returns to the primary prompt; in non-interactive mode, the @@ -372,7 +361,7 @@ If a script argument is given, the directory containing the script is inserted in the path in front of $PYTHONPATH. The search path can be manipulated from within a Python program as the variable -.I sys.path . +.IR sys.path . .IP PYTHONSTARTUP If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive @@ -429,9 +418,8 @@ specifying \fB\-v\fP multiple times. If this is set to a comma-separated string it is equivalent to specifying the \fB\-W\fP option for each separate value. .IP PYTHONHASHSEED -If this variable is set to "random", the effect is the same as specifying -the \fB-R\fP option: a random value is used to seed the hashes of str, -bytes and datetime objects. +If this variable is set to "random", a random value is used to seed the hashes +of str, bytes and datetime objects. If PYTHONHASHSEED is set to an integer value, it is used as a fixed seed for generating the hash() of the types covered by the hash randomization. Its @@ -440,8 +428,7 @@ interpreter itself, or to allow a cluster of python processes to share hash values. The integer must be a decimal number in the range [0,4294967295]. Specifying -the value 0 will lead to the same hash values as when hash randomization is -disabled. +the value 0 will disable hash randomization. .SH AUTHOR The Python Software Foundation: http://www.python.org/psf .SH INTERNET RESOURCES |