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

Skip to content

Commit c6c3178

Browse files
committed
Merged revisions 73190,73213,73257-73258,73260,73275,73294 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r73190 | georg.brandl | 2009-06-04 01:23:45 +0200 (Do, 04 Jun 2009) | 2 lines Avoid PendingDeprecationWarnings emitted by deprecated unittest methods. ........ r73213 | georg.brandl | 2009-06-04 12:15:57 +0200 (Do, 04 Jun 2009) | 1 line #5967: note that the C slicing APIs do not support negative indices. ........ r73257 | georg.brandl | 2009-06-06 19:50:05 +0200 (Sa, 06 Jun 2009) | 1 line #6211: elaborate a bit on ways to call the function. ........ r73258 | georg.brandl | 2009-06-06 19:51:31 +0200 (Sa, 06 Jun 2009) | 1 line #6204: use a real reference instead of "see later". ........ r73260 | georg.brandl | 2009-06-06 20:21:58 +0200 (Sa, 06 Jun 2009) | 1 line #6224: s/JPython/Jython/, and remove one link to a module nine years old. ........ r73275 | georg.brandl | 2009-06-07 22:37:52 +0200 (So, 07 Jun 2009) | 1 line Add Ezio. ........ r73294 | georg.brandl | 2009-06-08 15:34:52 +0200 (Mo, 08 Jun 2009) | 1 line #6194: O_SHLOCK/O_EXLOCK are not really more platform independent than lockf(). ........
1 parent 8d8f197 commit c6c3178

8 files changed

Lines changed: 28 additions & 19 deletions

File tree

Doc/c-api/list.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,19 @@ List Objects
112112

113113
.. cfunction:: PyObject* PyList_GetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high)
114114

115-
Return a list of the objects in *list* containing the objects *between*
116-
*low* and *high*. Return *NULL* and set an exception if unsuccessful.
117-
Analogous to ``list[low:high]``.
115+
Return a list of the objects in *list* containing the objects *between* *low*
116+
and *high*. Return *NULL* and set an exception if unsuccessful. Analogous
117+
to ``list[low:high]``. Negative indices, as when slicing from Python, are not
118+
supported.
118119

119120

120121
.. cfunction:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist)
121122

122123
Set the slice of *list* between *low* and *high* to the contents of
123124
*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may
124125
be *NULL*, indicating the assignment of an empty list (slice deletion).
125-
Return ``0`` on success, ``-1`` on failure.
126+
Return ``0`` on success, ``-1`` on failure. Negative indices, as when
127+
slicing from Python, are not supported.
126128

127129

128130
.. cfunction:: int PyList_Sort(PyObject *list)

Doc/library/fcntl.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ lay-out for the *lockdata* variable is system dependent --- therefore using the
145145

146146
Module :mod:`os`
147147
If the locking flags :const:`O_SHLOCK` and :const:`O_EXLOCK` are present
148-
in the :mod:`os` module, the :func:`os.open` function provides a more
149-
platform-independent alternative to the :func:`lockf` and :func:`flock`
150-
functions.
148+
in the :mod:`os` module (on BSD only), the :func:`os.open` function
149+
provides an alternative to the :func:`lockf` and :func:`flock` functions.
151150

Doc/library/platform.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Java Platform
160160

161161
.. function:: java_ver(release='', vendor='', vminfo=('','',''), osinfo=('','',''))
162162

163-
Version interface for JPython.
163+
Version interface for Jython.
164164

165165
Returns a tuple ``(release, vendor, vminfo, osinfo)`` with *vminfo* being a
166166
tuple ``(vm_name, vm_release, vm_vendor)`` and *osinfo* being a tuple

Doc/library/tkinter.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ is maintained at ActiveState.)
2323
`Tkinter reference: a GUI for Python <http://infohost.nmt.edu/tcc/help/pubs/lang.html>`_
2424
On-line reference material.
2525

26-
`Tkinter for JPython <http://jtkinter.sourceforge.net>`_
27-
The Jython interface to Tkinter.
28-
2926
`Python and Tkinter Programming <http://www.amazon.com/exec/obidos/ASIN/1884777813>`_
3027
The book by John Grayson (ISBN 1-884777-81-3).
3128

Doc/tutorial/controlflow.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ This example, as usual, demonstrates some new Python features:
317317
and ``methodname`` is the name of a method that is defined by the object's type.
318318
Different types define different methods. Methods of different types may have
319319
the same name without causing ambiguity. (It is possible to define your own
320-
object types and methods, using *classes*, as discussed later in this tutorial.)
320+
object types and methods, using *classes*, see :ref:`tut-classes`)
321321
The method :meth:`append` shown in the example is defined for list objects; it
322322
adds a new element at the end of the list. In this example it is equivalent to
323323
``result = result + [b]``, but more efficient.
@@ -344,15 +344,23 @@ defined to allow. For example::
344344
def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
345345
while True:
346346
ok = input(prompt)
347-
if ok in ('y', 'ye', 'yes'): return True
348-
if ok in ('n', 'no', 'nop', 'nope'): return False
347+
if ok in ('y', 'ye', 'yes'):
348+
return True
349+
if ok in ('n', 'no', 'nop', 'nope'):
350+
return False
349351
retries = retries - 1
350352
if retries < 0:
351353
raise IOError('refusenik user')
352354
print(complaint)
353355

354-
This function can be called either like this: ``ask_ok('Do you really want to
355-
quit?')`` or like this: ``ask_ok('OK to overwrite the file?', 2)``.
356+
This function can be called in several ways:
357+
358+
* giving only the mandatory argument:
359+
``ask_ok('Do you really want to quit?')``
360+
* giving one of the optional arguments:
361+
``ask_ok('OK to overwrite the file?', 2)``
362+
* or even giving all arguments:
363+
``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!')``
356364

357365
This example also introduces the :keyword:`in` keyword. This tests whether or
358366
not a sequence contains a certain value.

Lib/test/test_pep352.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_builtins_new_style(self):
1616

1717
def verify_instance_interface(self, ins):
1818
for attr in ("args", "__str__", "__repr__"):
19-
self.failUnless(hasattr(ins, attr),
19+
self.assertTrue(hasattr(ins, attr),
2020
"%s missing %s attribute" %
2121
(ins.__class__.__name__, attr))
2222

@@ -85,7 +85,7 @@ def test_inheritance(self):
8585

8686
def interface_test_driver(self, results):
8787
for test_name, (given, expected) in zip(self.interface_tests, results):
88-
self.failUnlessEqual(given, expected, "%s: %s != %s" % (test_name,
88+
self.assertEqual(given, expected, "%s: %s != %s" % (test_name,
8989
given, expected))
9090

9191
def test_interface_single_arg(self):

Misc/developers.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ the format to accommodate documentation needs as they arise.
1717
Permissions History
1818
-------------------
1919

20+
- Ezio Melotti was given SVN access on June 7 2009 by GFB, for work on and
21+
fixes to the documentation.
22+
2023
- Paul Kippes was given commit privileges at PyCon 2009 by BAC to work on 3to2.
2124

2225
- Ron DuPlain was given commit privileges at PyCon 2009 by BAC to work on 3to2.

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6830,7 +6830,7 @@ unicode_center(PyUnicodeObject *self, PyObject *args)
68306830

68316831
/* This code should go into some future Unicode collation support
68326832
module. The basic comparison should compare ordinals on a naive
6833-
basis (this is what Java does and thus JPython too). */
6833+
basis (this is what Java does and thus Jython too). */
68346834

68356835
/* speedy UTF-16 code point order comparison */
68366836
/* gleaned from: */

0 commit comments

Comments
 (0)