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

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 8 years 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 933
934 All non-keyword arguments are converted to strings like :func:`str` does and 934 All non-keyword arguments are converted to strings like :func:`str` does and
935 written to the stream, separated by *sep* and followed by *end*. Both *sep* 935 written to the stream, separated by *sep* and followed by *end*. Both *sep*
936 and *end* must be strings; they can also be ``None``, which means to use the 936 and *end* must be strings; they can also be ``None``, which means to use the
937 default values. If no *object* is given, :func:`print` will just write 937 default values. If no *object* is given, :func:`print` will just write
938 *end*. 938 *end*.
939 939
940 The *file* argument must be an object with a ``write(string)`` method; if it 940 The *file* argument must be an object with a ``write(string)`` method; if it
941 is not present or ``None``, :data:`sys.stdout` will be used. 941 is not present or ``None``, :data:`sys.stdout` will be used.
942 942
943 The default encoding used for the various system streams(:data:`sys.stdout`,
ezio.melotti 2011/08/26 18:54:20 Missing space after 'streams'
944 :data:`sys.stdin`, :data:`sys.stderr`) is set to the value of
eric.araujo 2011/08/26 18:07:45 Minor: it’s usual to order them as stdin, stdout,
945 PYTHONIOENCODING if defined, if it isn't defined it is gotten from
eric.araujo 2011/08/26 18:07:45 Using :envvar:`PYTHONIOENCODING` should create a l
946 the system file descriptor via :func:`os.device_encoding`, if that fails
eric.araujo 2011/08/26 18:07:45 s/system/stream/ ?
947 we try and get the encoding using :func:`locale.getpreferredencoding`,
eric.araujo 2011/08/26 18:07:45 I think the doc doesn’t use “we”. Passive voice l
948 and if that fails the encoding defaults to ascii.
eric.araujo 2011/08/26 18:07:45 ASCII*
ezio.melotti 2011/08/26 18:54:20 This sentence is a bit too long. Maybe you can ju
943 949
944 .. function:: property(fget=None, fset=None, fdel=None, doc=None) 950 .. function:: property(fget=None, fset=None, fdel=None, doc=None)
945 951
946 Return a property attribute. 952 Return a property attribute.
947 953
948 *fget* is a function for getting an attribute value, likewise *fset* is a 954 *fget* is a function for getting an attribute value, likewise *fset* is a
949 function for setting, and *fdel* a function for del'ing, an attribute. Typic al 955 function for setting, and *fdel* a function for del'ing, an attribute. Typic al
950 use is to define a managed attribute ``x``:: 956 use is to define a managed attribute ``x``::
951 957
952 class C: 958 class C:
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 1450
1445 .. rubric:: Footnotes 1451 .. rubric:: Footnotes
1446 1452
1447 .. [#] Note that the parser only accepts the Unix-style end of line convention. 1453 .. [#] Note that the parser only accepts the Unix-style end of line convention.
1448 If you are reading the code from a file, make sure to use newline conversion 1454 If you are reading the code from a file, make sure to use newline conversion
1449 mode to convert Windows or Mac-style newlines. 1455 mode to convert Windows or Mac-style newlines.
1450 1456
1451 .. [#] In the current implementation, local variable bindings cannot normally be 1457 .. [#] In the current implementation, local variable bindings cannot normally be
1452 affected this way, but variables retrieved from other scopes (such as modules ) 1458 affected this way, but variables retrieved from other scopes (such as modules )
1453 can be. This may change. 1459 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+