]> granicus.if.org Git - python/commitdiff
Merged revisions 63361-63373,63375,63377-63380 via svnmerge from
authorAlexandre Vassalotti <alexandre@peadrop.com>
Fri, 16 May 2008 18:15:12 +0000 (18:15 +0000)
committerAlexandre Vassalotti <alexandre@peadrop.com>
Fri, 16 May 2008 18:15:12 +0000 (18:15 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63361 | alexandre.vassalotti | 2008-05-16 03:14:08 -0400 (Fri, 16 May 2008) | 2 lines

  Rename the test file of reprlib.
........
  r63364 | georg.brandl | 2008-05-16 05:34:48 -0400 (Fri, 16 May 2008) | 2 lines

  Make generator repr consistent with function and code object repr.
........
  r63365 | georg.brandl | 2008-05-16 05:47:29 -0400 (Fri, 16 May 2008) | 2 lines

  #2869: remove parameter from signature.
........
  r63366 | christian.heimes | 2008-05-16 06:23:31 -0400 (Fri, 16 May 2008) | 1 line

  Fixed #2870: cmathmodule.c compile error
........
  r63367 | christian.heimes | 2008-05-16 07:28:56 -0400 (Fri, 16 May 2008) | 1 line

  Following Amaury's advice
........
  r63368 | georg.brandl | 2008-05-16 09:10:15 -0400 (Fri, 16 May 2008) | 2 lines

  #2890: support os.O_ASYNC and fcntl.FASYNC.
........
  r63369 | georg.brandl | 2008-05-16 09:18:50 -0400 (Fri, 16 May 2008) | 2 lines

  #2845: fix copy2's docs.
........
  r63370 | georg.brandl | 2008-05-16 09:24:29 -0400 (Fri, 16 May 2008) | 2 lines

  Don't allow keyword arguments to reversed().
........
  r63373 | georg.brandl | 2008-05-16 09:41:26 -0400 (Fri, 16 May 2008) | 2 lines

  Document O_ASYNC addition.
........
  r63380 | georg.brandl | 2008-05-16 13:33:13 -0400 (Fri, 16 May 2008) | 2 lines

  Fix reprlib docs.
........

15 files changed:
Doc/library/calendar.rst
Doc/library/datatypes.rst
Doc/library/os.rst
Doc/library/reprlib.rst
Doc/library/shutil.rst
Lib/test/test_enumerate.py
Lib/test/test_generators.py
Lib/test/test_genexps.py
Lib/test/test_reprlib.py [moved from Lib/test/test_repr.py with 100% similarity]
Misc/NEWS
Modules/cmathmodule.c
Modules/fcntlmodule.c
Modules/posixmodule.c
Objects/enumobject.c
Objects/genobject.c

index 112a6727bc206b4323d4d7f23438e19335b299a0..d575228f7bf4069480c69946670bd7377c5f6b61 100644 (file)
@@ -35,7 +35,7 @@ it's the base calendar for all computations.
 
    :class:`Calendar` instances have the following methods:
 
-   .. method:: iterweekdays(weekday)
+   .. method:: iterweekdays()
 
       Return an iterator for the week day numbers that will be used for one
       week.  The first value from the iterator will be the same as the value of
index f561cb807ea5c357a2b2857aff15d925e6156821..99d062b190e3d8f44c284bb3237a273329b4002b 100644 (file)
@@ -31,4 +31,4 @@ The following modules are documented in this chapter:
    types.rst
    copy.rst
    pprint.rst
-   repr.rst
+   reprlib.rst
index 551424d93344f178f4123be4b823bb425e42dab7..2badfd3f025bf2d31ef1a20b6dca74563ae373e2 100644 (file)
@@ -613,7 +613,8 @@ platforms.  For descriptions of their availability and use, consult
    combined using the bitwise OR operator ``|``. Availability: Windows.
 
 
-.. data:: O_DIRECT
+.. data:: O_ASYNC
+          O_DIRECT
           O_DIRECTORY
           O_NOFOLLOW
           O_NOATIME
index 84fd6fb982915976cb0d10934221ce770545a3ac..a0664c7e0b1164c9d480b0ea1d235196bde773d1 100644 (file)
@@ -1,6 +1,6 @@
-
 :mod:`reprlib` --- Alternate :func:`repr` implementation
-=====================================================
+========================================================
+
 
 .. module:: reprlib
    :synopsis: Alternate repr() implementation with size limits.
index a3ab3877abd7c4d2bc8879bbf9bd1acaeee86088..5ab2f29ef16a38ae482ca4490d9cd2850d088091 100644 (file)
@@ -73,8 +73,9 @@ copying and removal. For operations on individual files, see also the
 
 .. function:: copy2(src, dst)
 
-   Similar to :func:`copy`, but last access time and last modification time are
-   copied as well.  This is similar to the Unix command :program:`cp -p`.
+   Similar to :func:`copy`, but metadata is copied as well -- in fact, this is just
+   :func:`copy` followed by :func:`copystat`.  This is similar to the
+   Unix command :program:`cp -p`.
 
 
 .. function:: copytree(src, dst[, symlinks])
index 8cebf444696d4809d095906a2e7e29569c6dc360..f5c568995b11d3c3a3ea28b461d0136abe2924b6 100644 (file)
@@ -138,6 +138,8 @@ class TestReversed(unittest.TestCase):
         for data in 'abc', range(5), tuple(enumerate('abc')), A(), range(1,17,5):
             self.assertEqual(list(data)[::-1], list(reversed(data)))
         self.assertRaises(TypeError, reversed, {})
+        # don't allow keyword arguments
+        self.assertRaises(TypeError, reversed, [], a=1)
 
     def test_range_optimization(self):
         x = range(1)
index e27eaddaaeea5d1e3c0d1b07cccd668feceb1af1..56f23db042df9429ac60d62dc0a3b4bf97e272ae 100644 (file)
@@ -927,7 +927,7 @@ Test the __name__ attribute and the repr()
 >>> g.__name__
 'f'
 >>> repr(g)  # doctest: +ELLIPSIS
-'<f generator object at ...>'
+'<generator object f at ...>'
 """
 
 # conjoin is a simple backtracking generator, named in honor of Icon's
index c8abbccb0c5e0378bb290af33624cadf1bcdaa1d..593c1c5b578d3313f435a6f4253d970b6a73aff9 100644 (file)
@@ -92,7 +92,7 @@ Verify that parenthesis are required when used as a keyword argument value
 Verify that parenthesis are required when used as a keyword argument value
 
     >>> dict(a = (i for i in range(10))) #doctest: +ELLIPSIS
-    {'a': <<genexpr> generator object at ...>}
+    {'a': <generator object <genexpr> at ...>}
 
 Verify early binding for the outermost for-expression
 
index f39563ab3977d47802836c00454cab44e51d4a96..0e986c83bd712d4bd4bc13f2efec108587a371bc 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -39,7 +39,11 @@ Core and Builtins
 Extension Modules
 -----------------
 
-- Support for Windows9x has been removed from the winsound module.
+- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the platform.
+
+- Support for Windows 9x has been removed from the winsound module.
+
+- Fixed #2870: cmathmodule.c compile error
 
 Library
 -------
index d6d1f27cb0944e43c4a2434d9fee07647cb3588b..109f2cc9f9f9ff973e692764f51441bb0aaff38e 100644 (file)
@@ -920,7 +920,7 @@ cmath_phase(PyObject *self, PyObject *args)
        errno = 0;
        PyFPE_START_PROTECT("arg function", return 0)
        phi = c_atan2(z);
-       PyFPE_END_PROTECT(r)
+       PyFPE_END_PROTECT(phi)
        if (errno != 0)
                return math_error();
        else
index 6447e5686ba9fc0f6888f3b086f0acdd2cf513f6..c5d41f29cdd32cd1dd36c255f099176b53e98164 100644 (file)
@@ -510,6 +510,9 @@ all_ins(PyObject* d)
         if (ins(d, "F_SETLKW64", (long)F_SETLKW64)) return -1;
 #endif
 /* GNU extensions, as of glibc 2.2.4. */
+#ifdef FASYNC
+        if (ins(d, "FASYNC", (long)FASYNC)) return -1;
+#endif
 #ifdef F_SETLEASE
         if (ins(d, "F_SETLEASE", (long)F_SETLEASE)) return -1;
 #endif
index 99efa561d2cfbfde066c8ffa691255f7bed336f9..33bcbd5e7b771edbf93847b7f3bd12252d3c15c9 100644 (file)
@@ -7212,6 +7212,11 @@ all_ins(PyObject *d)
 #endif
 
 /* GNU extensions. */
+#ifdef O_ASYNC
+        /* Send a SIGIO signal whenever input or output 
+           becomes available on file descriptor */
+        if (ins(d, "O_ASYNC", (long)O_ASYNC)) return -1;
+#endif
 #ifdef O_DIRECT
         /* Direct disk access. */
         if (ins(d, "O_DIRECT", (long)O_DIRECT)) return -1;
index 5c60d8ca2e9b29e4dbca7bc8c4f2e0200e56f4f7..c1a18726b4515c5db760b4f52adc6a0e9aadf5d4 100644 (file)
@@ -217,7 +217,10 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
        PyObject *seq;
        reversedobject *ro;
 
-       if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq))
+       if (type == &PyReversed_Type && !_PyArg_NoKeywords("reversed()", kwds))
+               return NULL;
+
+       if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) )
                return NULL;
 
        if (PyObject_HasAttrString(seq, "__reversed__"))
index c76bcb686d27290928d3241c46ed92e2f70743e5..72ddaefb3a465d880aa60837de5467802ce6760a 100644 (file)
@@ -285,7 +285,7 @@ gen_iternext(PyGenObject *gen)
 static PyObject *
 gen_repr(PyGenObject *gen)
 {
-       return PyUnicode_FromFormat("<%S generator object at %p>",
+       return PyUnicode_FromFormat("<generator object %S at %p>",
                                    ((PyCodeObject *)gen->gi_code)->co_name,
                                    gen);
 }