Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18452)

Side by Side Diff: Doc/library/functions.rst

Issue 12832: The documentation for the print function should explain/point to how to control the sys.stdout encoding
Patch Set: Created 7 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 .. XXX document all delegations to __special__ methods 1 .. XXX document all delegations to __special__ methods
2 .. _built-in-funcs: 2 .. _built-in-funcs:
3 3
4 Built-in Functions 4 Built-in Functions
5 ================== 5 ==================
6 6
7 The Python interpreter has a number of functions and types built into it that 7 The Python interpreter has a number of functions and types built into it that
8 are always available. They are listed here in alphabetical order. 8 are always available. They are listed here in alphabetical order.
9 9
10 =================== ================= ================== ================ == ================== 10 =================== ================= ================== ================ == ==================
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 954
955 All non-keyword arguments are converted to strings like :func:`str` does and 955 All non-keyword arguments are converted to strings like :func:`str` does and
956 written to the stream, separated by *sep* and followed by *end*. Both *sep* 956 written to the stream, separated by *sep* and followed by *end*. Both *sep*
957 and *end* must be strings; they can also be ``None``, which means to use the 957 and *end* must be strings; they can also be ``None``, which means to use the
958 default values. If no *object* is given, :func:`print` will just write 958 default values. If no *object* is given, :func:`print` will just write
959 *end*. 959 *end*.
960 960
961 The *file* argument must be an object with a ``write(string)`` method; if it 961 The *file* argument must be an object with a ``write(string)`` method; if it
962 is not present or ``None``, :data:`sys.stdout` will be used. 962 is not present or ``None``, :data:`sys.stdout` will be used.
963 963
964 The default encoding used for the various system streams (:data:`sys.stdin`,
965 :data:`sys.stdout`, :data:`sys.stderr`) is set to the value of
966 :envvar:`PYTHONIOENCODING` if defined, or if it isn't defined it is retrieved from
967 the standard stream via :func:`os.device_encoding` or :func:`locale.getprefer redencoding`.
968
969 If the above fails the encoding defaults to ASCII.
964 970
965 .. function:: property(fget=None, fset=None, fdel=None, doc=None) 971 .. function:: property(fget=None, fset=None, fdel=None, doc=None)
966 972
967 Return a property attribute. 973 Return a property attribute.
968 974
969 *fget* is a function for getting an attribute value, likewise *fset* is a 975 *fget* is a function for getting an attribute value, likewise *fset* is a
970 function for setting, and *fdel* a function for del'ing, an attribute. Typic al 976 function for setting, and *fdel* a function for del'ing, an attribute. Typic al
971 use is to define a managed attribute ``x``:: 977 use is to define a managed attribute ``x``::
972 978
973 class C: 979 class C:
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 1490
1485 .. rubric:: Footnotes 1491 .. rubric:: Footnotes
1486 1492
1487 .. [#] Note that the parser only accepts the Unix-style end of line convention. 1493 .. [#] Note that the parser only accepts the Unix-style end of line convention.
1488 If you are reading the code from a file, make sure to use newline conversion 1494 If you are reading the code from a file, make sure to use newline conversion
1489 mode to convert Windows or Mac-style newlines. 1495 mode to convert Windows or Mac-style newlines.
1490 1496
1491 .. [#] In the current implementation, local variable bindings cannot normally be 1497 .. [#] In the current implementation, local variable bindings cannot normally be
1492 affected this way, but variables retrieved from other scopes (such as modules ) 1498 affected this way, but variables retrieved from other scopes (such as modules )
1493 can be. This may change. 1499 can be. This may change.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+