diff options
author | Georg Brandl <georg@python.org> | 2009-06-08 13:41:29 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-06-08 13:41:29 (GMT) |
commit | c6c31789426faa6ad47f210f6fce6d7c2e92ac56 (patch) | |
tree | 3f7c3a006df0e9c819c91e246c241d480ed0e7bc | |
parent | 8d8f197c9ccec9320d9daa9b9c2ce54159e689f9 (diff) | |
download | cpython-c6c31789426faa6ad47f210f6fce6d7c2e92ac56.zip cpython-c6c31789426faa6ad47f210f6fce6d7c2e92ac56.tar.gz cpython-c6c31789426faa6ad47f210f6fce6d7c2e92ac56.tar.bz2 |
Merged revisions 73190,73213,73257-73258,73260,73275,73294 via svnmerge from
svn+ssh://pythondev@svn.python.org/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().
........
-rw-r--r-- | Doc/c-api/list.rst | 10 | ||||
-rw-r--r-- | Doc/library/fcntl.rst | 5 | ||||
-rw-r--r-- | Doc/library/platform.rst | 2 | ||||
-rw-r--r-- | Doc/library/tkinter.rst | 3 | ||||
-rw-r--r-- | Doc/tutorial/controlflow.rst | 18 | ||||
-rw-r--r-- | Lib/test/test_pep352.py | 4 | ||||
-rw-r--r-- | Misc/developers.txt | 3 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 2 |
8 files changed, 28 insertions, 19 deletions
diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst index 7b8cd5c..c76644a 100644 --- a/Doc/c-api/list.rst +++ b/Doc/c-api/list.rst @@ -112,9 +112,10 @@ List Objects .. cfunction:: PyObject* PyList_GetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high) - Return a list of the objects in *list* containing the objects *between* - *low* and *high*. Return *NULL* and set an exception if unsuccessful. - Analogous to ``list[low:high]``. + Return a list of the objects in *list* containing the objects *between* *low* + and *high*. Return *NULL* and set an exception if unsuccessful. Analogous + to ``list[low:high]``. Negative indices, as when slicing from Python, are not + supported. .. cfunction:: int PyList_SetSlice(PyObject *list, Py_ssize_t low, Py_ssize_t high, PyObject *itemlist) @@ -122,7 +123,8 @@ List Objects Set the slice of *list* between *low* and *high* to the contents of *itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may be *NULL*, indicating the assignment of an empty list (slice deletion). - Return ``0`` on success, ``-1`` on failure. + Return ``0`` on success, ``-1`` on failure. Negative indices, as when + slicing from Python, are not supported. .. cfunction:: int PyList_Sort(PyObject *list) diff --git a/Doc/library/fcntl.rst b/Doc/library/fcntl.rst index 97fbb50..aaff852 100644 --- a/Doc/library/fcntl.rst +++ b/Doc/library/fcntl.rst @@ -145,7 +145,6 @@ lay-out for the *lockdata* variable is system dependent --- therefore using the Module :mod:`os` If the locking flags :const:`O_SHLOCK` and :const:`O_EXLOCK` are present - in the :mod:`os` module, the :func:`os.open` function provides a more - platform-independent alternative to the :func:`lockf` and :func:`flock` - functions. + in the :mod:`os` module (on BSD only), the :func:`os.open` function + provides an alternative to the :func:`lockf` and :func:`flock` functions. diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index 447253b..7be6d7b 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -160,7 +160,7 @@ Java Platform .. function:: java_ver(release='', vendor='', vminfo=('','',''), osinfo=('','','')) - Version interface for JPython. + Version interface for Jython. Returns a tuple ``(release, vendor, vminfo, osinfo)`` with *vminfo* being a tuple ``(vm_name, vm_release, vm_vendor)`` and *osinfo* being a tuple diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index 55cc668..7413987 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -23,9 +23,6 @@ is maintained at ActiveState.) `Tkinter reference: a GUI for Python <http://infohost.nmt.edu/tcc/help/pubs/lang.html>`_ On-line reference material. - `Tkinter for JPython <http://jtkinter.sourceforge.net>`_ - The Jython interface to Tkinter. - `Python and Tkinter Programming <http://www.amazon.com/exec/obidos/ASIN/1884777813>`_ The book by John Grayson (ISBN 1-884777-81-3). diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 98f76ff..e266a04 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -317,7 +317,7 @@ This example, as usual, demonstrates some new Python features: and ``methodname`` is the name of a method that is defined by the object's type. Different types define different methods. Methods of different types may have the same name without causing ambiguity. (It is possible to define your own - object types and methods, using *classes*, as discussed later in this tutorial.) + object types and methods, using *classes*, see :ref:`tut-classes`) The method :meth:`append` shown in the example is defined for list objects; it adds a new element at the end of the list. In this example it is equivalent to ``result = result + [b]``, but more efficient. @@ -344,15 +344,23 @@ defined to allow. For example:: def ask_ok(prompt, retries=4, complaint='Yes or no, please!'): while True: ok = input(prompt) - if ok in ('y', 'ye', 'yes'): return True - if ok in ('n', 'no', 'nop', 'nope'): return False + if ok in ('y', 'ye', 'yes'): + return True + if ok in ('n', 'no', 'nop', 'nope'): + return False retries = retries - 1 if retries < 0: raise IOError('refusenik user') print(complaint) -This function can be called either like this: ``ask_ok('Do you really want to -quit?')`` or like this: ``ask_ok('OK to overwrite the file?', 2)``. +This function can be called in several ways: + +* giving only the mandatory argument: + ``ask_ok('Do you really want to quit?')`` +* giving one of the optional arguments: + ``ask_ok('OK to overwrite the file?', 2)`` +* or even giving all arguments: + ``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or no!')`` This example also introduces the :keyword:`in` keyword. This tests whether or not a sequence contains a certain value. diff --git a/Lib/test/test_pep352.py b/Lib/test/test_pep352.py index 5d75667..1481244 100644 --- a/Lib/test/test_pep352.py +++ b/Lib/test/test_pep352.py @@ -16,7 +16,7 @@ class ExceptionClassTests(unittest.TestCase): def verify_instance_interface(self, ins): for attr in ("args", "__str__", "__repr__"): - self.failUnless(hasattr(ins, attr), + self.assertTrue(hasattr(ins, attr), "%s missing %s attribute" % (ins.__class__.__name__, attr)) @@ -85,7 +85,7 @@ class ExceptionClassTests(unittest.TestCase): def interface_test_driver(self, results): for test_name, (given, expected) in zip(self.interface_tests, results): - self.failUnlessEqual(given, expected, "%s: %s != %s" % (test_name, + self.assertEqual(given, expected, "%s: %s != %s" % (test_name, given, expected)) def test_interface_single_arg(self): diff --git a/Misc/developers.txt b/Misc/developers.txt index 3cc7c26..634101c 100644 --- a/Misc/developers.txt +++ b/Misc/developers.txt @@ -17,6 +17,9 @@ the format to accommodate documentation needs as they arise. Permissions History ------------------- +- Ezio Melotti was given SVN access on June 7 2009 by GFB, for work on and + fixes to the documentation. + - Paul Kippes was given commit privileges at PyCon 2009 by BAC to work on 3to2. - Ron DuPlain was given commit privileges at PyCon 2009 by BAC to work on 3to2. diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 7cc7037..0d4a3dd 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6830,7 +6830,7 @@ unicode_center(PyUnicodeObject *self, PyObject *args) /* This code should go into some future Unicode collation support module. The basic comparison should compare ordinals on a naive - basis (this is what Java does and thus JPython too). */ + basis (this is what Java does and thus Jython too). */ /* speedy UTF-16 code point order comparison */ /* gleaned from: */ |