: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
types.rst
copy.rst
pprint.rst
- repr.rst
+ reprlib.rst
combined using the bitwise OR operator ``|``. Availability: Windows.
-.. data:: O_DIRECT
+.. data:: O_ASYNC
+ O_DIRECT
O_DIRECTORY
O_NOFOLLOW
O_NOATIME
-
:mod:`reprlib` --- Alternate :func:`repr` implementation
-=====================================================
+========================================================
+
.. module:: reprlib
:synopsis: Alternate repr() implementation with size limits.
.. 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])
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)
>>> 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
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
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
-------
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
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
#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;
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__"))
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);
}