Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a85ee5c

Browse files
committed
Recorded merge of revisions 74057 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k (Only selected revisions.) ................ r74057 | alexandre.vassalotti | 2009-07-17 12:42:05 +0200 (Fr, 17 Jul 2009) | 54 lines Merged revisions 73930-73932,73937-73939,73945,73951,73954,73962-73963,73970 via svnmerge from svn+ssh://[email protected]/python/trunk ........ r73930 | amaury.forgeotdarc | 2009-07-10 12:47:42 -0400 (Fri, 10 Jul 2009) | 2 lines #6447: typo in subprocess docstring ........ r73937 | georg.brandl | 2009-07-11 06:12:36 -0400 (Sat, 11 Jul 2009) | 1 line Fix style. ........ r73938 | georg.brandl | 2009-07-11 06:14:54 -0400 (Sat, 11 Jul 2009) | 1 line #6446: fix import_spam() function to use correct error and reference handling. ........ r73939 | georg.brandl | 2009-07-11 06:18:10 -0400 (Sat, 11 Jul 2009) | 1 line #6448: clarify docs for find_module(). ........ r73945 | georg.brandl | 2009-07-11 06:51:31 -0400 (Sat, 11 Jul 2009) | 1 line #6456: clarify the meaning of constants used as arguments to nl_langinfo(). ........ r73951 | georg.brandl | 2009-07-11 10:23:38 -0400 (Sat, 11 Jul 2009) | 2 lines array.array is actually a class. ................
1 parent ac73c5f commit a85ee5c

5 files changed

Lines changed: 141 additions & 150 deletions

File tree

Doc/c-api/import.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Importing Modules
2525
imported module, or *NULL* with an exception set on failure. A failing
2626
import of a module doesn't leave the module in :data:`sys.modules`.
2727

28+
This function always uses absolute imports.
29+
2830

2931
.. cfunction:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
3032

@@ -75,6 +77,8 @@ Importing Modules
7577
current globals. This means that the import is done using whatever import
7678
hooks are installed in the current environment.
7779

80+
This function always uses absolute imports.
81+
7882

7983
.. cfunction:: PyObject* PyImport_ReloadModule(PyObject *m)
8084

Doc/library/array.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ through the :attr:`itemsize` attribute.
5252
The module defines the following type:
5353

5454

55-
.. function:: array(typecode[, initializer])
55+
.. class:: array(typecode[, initializer])
5656

57-
Return a new array whose items are restricted by *typecode*, and initialized
57+
A new array whose items are restricted by *typecode*, and initialized
5858
from the optional *initializer* value, which must be a list, object
5959
supporting the buffer interface, or iterable over elements of the
6060
appropriate type.
@@ -67,7 +67,7 @@ The module defines the following type:
6767

6868
.. data:: ArrayType
6969

70-
Obsolete alias for :func:`array`.
70+
Obsolete alias for :class:`array`.
7171

7272
.. data:: typecodes
7373

@@ -81,7 +81,6 @@ and may be used wherever buffer objects are supported.
8181

8282
The following data items and methods are also supported:
8383

84-
8584
.. attribute:: array.typecode
8685

8786
The typecode character used to create the array.

Doc/library/imp.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,17 @@ This module provides an interface to the mechanisms used to implement the
3333

3434
.. function:: find_module(name[, path])
3535

36-
Try to find the module *name* on the search path *path*. If *path* is a list
37-
of directory names, each directory is searched for files with any of the
38-
suffixes returned by :func:`get_suffixes` above. Invalid names in the list
39-
are silently ignored (but all list items must be strings). If *path* is
40-
omitted or ``None``, the list of directory names given by ``sys.path`` is
41-
searched, but first it searches a few special places: it tries to find a
42-
built-in module with the given name (:const:`C_BUILTIN`), then a frozen
43-
module (:const:`PY_FROZEN`), and on some systems some other places are looked
44-
in as well (on Windows, it looks in the registry which may point to a
45-
specific file).
36+
Try to find the module *name*. If *path* is omitted or ``None``, the list of
37+
directory names given by ``sys.path`` is searched, but first a few special
38+
places are searched: the function tries to find a built-in module with the
39+
given name (:const:`C_BUILTIN`), then a frozen module (:const:`PY_FROZEN`),
40+
and on some systems some other places are looked in as well (on Windows, it
41+
looks in the registry which may point to a specific file).
42+
43+
Otherwise, *path* must be a list of directory names; each directory is
44+
searched for files with any of the suffixes returned by :func:`get_suffixes`
45+
above. Invalid names in the list are silently ignored (but all list items
46+
must be strings).
4647

4748
If search is successful, the return value is a 3-element tuple ``(file,
4849
pathname, description)``:

Doc/library/locale.rst

Lines changed: 121 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,127 @@ The :mod:`locale` module defines the following exception and functions:
144144

145145
.. function:: nl_langinfo(option)
146146

147-
Return some locale-specific information as a string. This function is not
148-
available on all systems, and the set of possible options might also vary across
149-
platforms. The possible argument values are numbers, for which symbolic
150-
constants are available in the locale module.
147+
Return some locale-specific information as a string. This function is not
148+
available on all systems, and the set of possible options might also vary
149+
across platforms. The possible argument values are numbers, for which
150+
symbolic constants are available in the locale module.
151151

152+
The :func:`nl_langinfo` function accepts one of the following keys. Most
153+
descriptions are taken from the corresponding description in the GNU C
154+
library.
152155

153-
.. function:: getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE'))
156+
.. data:: CODESET
157+
158+
Get a string with the name of the character encoding used in the
159+
selected locale.
160+
161+
.. data:: D_T_FMT
162+
163+
Get a string that can be used as a format string for :func:`strftime` to
164+
represent time and date in a locale-specific way.
165+
166+
.. data:: D_FMT
167+
168+
Get a string that can be used as a format string for :func:`strftime` to
169+
represent a date in a locale-specific way.
170+
171+
.. data:: T_FMT
172+
173+
Get a string that can be used as a format string for :func:`strftime` to
174+
represent a time in a locale-specific way.
175+
176+
.. data:: T_FMT_AMPM
177+
178+
Get a format string for :func:`strftime` to represent time in the am/pm
179+
format.
180+
181+
.. data:: DAY_1 ... DAY_7
182+
183+
Get the name of the n-th day of the week.
184+
185+
.. note::
186+
187+
This follows the US convention of :const:`DAY_1` being Sunday, not the
188+
international convention (ISO 8601) that Monday is the first day of the
189+
week.
190+
191+
.. data:: ABDAY_1 ... ABDAY_7
192+
193+
Get the abbreviated name of the n-th day of the week.
194+
195+
.. data:: MON_1 ... MON_12
196+
197+
Get the name of the n-th month.
198+
199+
.. data:: ABMON_1 ... ABMON_12
200+
201+
Get the abbreviated name of the n-th month.
202+
203+
.. data:: RADIXCHAR
204+
205+
Get the radix character (decimal dot, decimal comma, etc.)
206+
207+
.. data:: THOUSEP
208+
209+
Get the separator character for thousands (groups of three digits).
210+
211+
.. data:: YESEXPR
212+
213+
Get a regular expression that can be used with the regex function to
214+
recognize a positive response to a yes/no question.
215+
216+
.. note::
217+
218+
The expression is in the syntax suitable for the :cfunc:`regex` function
219+
from the C library, which might differ from the syntax used in :mod:`re`.
220+
221+
.. data:: NOEXPR
222+
223+
Get a regular expression that can be used with the regex(3) function to
224+
recognize a negative response to a yes/no question.
225+
226+
.. data:: CRNCYSTR
227+
228+
Get the currency symbol, preceded by "-" if the symbol should appear before
229+
the value, "+" if the symbol should appear after the value, or "." if the
230+
symbol should replace the radix character.
231+
232+
.. data:: ERA
233+
234+
Get a string that represents the era used in the current locale.
235+
236+
Most locales do not define this value. An example of a locale which does
237+
define this value is the Japanese one. In Japan, the traditional
238+
representation of dates includes the name of the era corresponding to the
239+
then-emperor's reign.
240+
241+
Normally it should not be necessary to use this value directly. Specifying
242+
the ``E`` modifier in their format strings causes the :func:`strftime`
243+
function to use this information. The format of the returned string is not
244+
specified, and therefore you should not assume knowledge of it on different
245+
systems.
246+
247+
.. data:: ERA_YEAR
248+
249+
Get the year in the relevant era of the locale.
250+
251+
.. data:: ERA_D_T_FMT
252+
253+
Get a format string for :func:`strftime` to represent dates and times in a
254+
locale-specific era-based way.
255+
256+
.. data:: ERA_D_FMT
257+
258+
Get a format string for :func:`strftime` to represent time in a
259+
locale-specific era-based way.
260+
261+
.. data:: ALT_DIGITS
262+
263+
Get a representation of up to 100 values used to represent the values
264+
0 to 99.
265+
266+
267+
.. function:: getdefaultlocale([envvars])
154268

155269
Tries to determine the default locale settings and returns them as a tuple of
156270
the form ``(language code, encoding)``.
@@ -338,140 +452,13 @@ The :mod:`locale` module defines the following exception and functions:
338452
This is a symbolic constant used for different values returned by
339453
:func:`localeconv`.
340454

341-
The :func:`nl_langinfo` function accepts one of the following keys. Most
342-
descriptions are taken from the corresponding description in the GNU C library.
343-
344-
345-
.. data:: CODESET
346-
347-
Return a string with the name of the character encoding used in the selected
348-
locale.
349-
350-
351-
.. data:: D_T_FMT
352-
353-
Return a string that can be used as a format string for strftime(3) to represent
354-
time and date in a locale-specific way.
355-
356-
357-
.. data:: D_FMT
358-
359-
Return a string that can be used as a format string for strftime(3) to represent
360-
a date in a locale-specific way.
361-
362-
363-
.. data:: T_FMT
364-
365-
Return a string that can be used as a format string for strftime(3) to represent
366-
a time in a locale-specific way.
367-
368-
369-
.. data:: T_FMT_AMPM
370-
371-
The return value can be used as a format string for 'strftime' to represent time
372-
in the am/pm format.
373-
374-
375-
.. data:: DAY_1 ... DAY_7
376-
377-
Return name of the n-th day of the week.
378-
379-
.. note::
380-
381-
This follows the US convention of :const:`DAY_1` being Sunday, not the
382-
international convention (ISO 8601) that Monday is the first day of the week.
383-
384-
385-
.. data:: ABDAY_1 ... ABDAY_7
386-
387-
Return abbreviated name of the n-th day of the week.
388-
389-
390-
.. data:: MON_1 ... MON_12
391-
392-
Return name of the n-th month.
393-
394-
395-
.. data:: ABMON_1 ... ABMON_12
396-
397-
Return abbreviated name of the n-th month.
398-
399-
400-
.. data:: RADIXCHAR
401-
402-
Return radix character (decimal dot, decimal comma, etc.)
403-
404-
405-
.. data:: THOUSEP
406-
407-
Return separator character for thousands (groups of three digits).
408-
409-
410-
.. data:: YESEXPR
411-
412-
Return a regular expression that can be used with the regex function to
413-
recognize a positive response to a yes/no question.
414-
415-
.. note::
416-
417-
The expression is in the syntax suitable for the :cfunc:`regex` function from
418-
the C library, which might differ from the syntax used in :mod:`re`.
419-
420-
421-
.. data:: NOEXPR
422-
423-
Return a regular expression that can be used with the regex(3) function to
424-
recognize a negative response to a yes/no question.
425-
426-
427-
.. data:: CRNCYSTR
428-
429-
Return the currency symbol, preceded by "-" if the symbol should appear before
430-
the value, "+" if the symbol should appear after the value, or "." if the symbol
431-
should replace the radix character.
432-
433-
434-
.. data:: ERA
435-
436-
The return value represents the era used in the current locale.
437-
438-
Most locales do not define this value. An example of a locale which does define
439-
this value is the Japanese one. In Japan, the traditional representation of
440-
dates includes the name of the era corresponding to the then-emperor's reign.
441-
442-
Normally it should not be necessary to use this value directly. Specifying the
443-
``E`` modifier in their format strings causes the :func:`strftime` function to
444-
use this information. The format of the returned string is not specified, and
445-
therefore you should not assume knowledge of it on different systems.
446-
447-
448-
.. data:: ERA_YEAR
449-
450-
The return value gives the year in the relevant era of the locale.
451-
452-
453-
.. data:: ERA_D_T_FMT
454-
455-
This return value can be used as a format string for :func:`strftime` to
456-
represent dates and times in a locale-specific era-based way.
457-
458-
459-
.. data:: ERA_D_FMT
460-
461-
This return value can be used as a format string for :func:`strftime` to
462-
represent time in a locale-specific era-based way.
463-
464-
465-
.. data:: ALT_DIGITS
466-
467-
The return value is a representation of up to 100 values used to represent the
468-
values 0 to 99.
469455

470456
Example::
471457

472458
>>> import locale
473459
>>> loc = locale.getlocale() # get current locale
474-
>>> locale.setlocale(locale.LC_ALL, 'de_DE') # use German locale; name might vary with platform
460+
# use German locale; name might vary with platform
461+
>>> locale.setlocale(locale.LC_ALL, 'de_DE')
475462
>>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut
476463
>>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
477464
>>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale

Lib/subprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ def poll(self):
723723
# Windows methods
724724
#
725725
def _get_handles(self, stdin, stdout, stderr):
726-
"""Construct and return tupel with IO objects:
726+
"""Construct and return tuple with IO objects:
727727
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
728728
"""
729729
if stdin is None and stdout is None and stderr is None:
@@ -958,7 +958,7 @@ def terminate(self):
958958
# POSIX methods
959959
#
960960
def _get_handles(self, stdin, stdout, stderr):
961-
"""Construct and return tupel with IO objects:
961+
"""Construct and return tuple with IO objects:
962962
p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
963963
"""
964964
p2cread, p2cwrite = None, None

0 commit comments

Comments
 (0)