[Python-3000-checkins] r63385 - in python/branches/py3k: 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_repr.py Lib/test/test_reprlib.py Misc/NEWS Modules/cmathmodule.c Modules/fcntlmodule.c Modules/posixmodule.c Objects/enumobject.c Objects/genobject.c

alexandre.vassalotti python-3000-checkins at python.org
Fri May 16 20:15:14 CEST 2008


Author: alexandre.vassalotti
Date: Fri May 16 20:15:12 2008
New Revision: 63385

Log:
Merged revisions 63361-63373,63375,63377-63380 via svnmerge from 
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.
........


Added:
   python/branches/py3k/Lib/test/test_reprlib.py
      - copied unchanged from r63376, /python/branches/py3k/Lib/test/test_repr.py
Removed:
   python/branches/py3k/Lib/test/test_repr.py
Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Doc/library/calendar.rst
   python/branches/py3k/Doc/library/datatypes.rst
   python/branches/py3k/Doc/library/os.rst
   python/branches/py3k/Doc/library/reprlib.rst
   python/branches/py3k/Doc/library/shutil.rst
   python/branches/py3k/Lib/test/test_enumerate.py
   python/branches/py3k/Lib/test/test_generators.py
   python/branches/py3k/Lib/test/test_genexps.py
   python/branches/py3k/Misc/NEWS
   python/branches/py3k/Modules/cmathmodule.c
   python/branches/py3k/Modules/fcntlmodule.c
   python/branches/py3k/Modules/posixmodule.c
   python/branches/py3k/Objects/enumobject.c
   python/branches/py3k/Objects/genobject.c

Modified: python/branches/py3k/Doc/library/calendar.rst
==============================================================================
--- python/branches/py3k/Doc/library/calendar.rst	(original)
+++ python/branches/py3k/Doc/library/calendar.rst	Fri May 16 20:15:12 2008
@@ -35,7 +35,7 @@
 
    :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

Modified: python/branches/py3k/Doc/library/datatypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/datatypes.rst	(original)
+++ python/branches/py3k/Doc/library/datatypes.rst	Fri May 16 20:15:12 2008
@@ -31,4 +31,4 @@
    types.rst
    copy.rst
    pprint.rst
-   repr.rst
+   reprlib.rst

Modified: python/branches/py3k/Doc/library/os.rst
==============================================================================
--- python/branches/py3k/Doc/library/os.rst	(original)
+++ python/branches/py3k/Doc/library/os.rst	Fri May 16 20:15:12 2008
@@ -613,7 +613,8 @@
    combined using the bitwise OR operator ``|``. Availability: Windows.
 
 
-.. data:: O_DIRECT
+.. data:: O_ASYNC
+          O_DIRECT
           O_DIRECTORY
           O_NOFOLLOW
           O_NOATIME

Modified: python/branches/py3k/Doc/library/reprlib.rst
==============================================================================
--- python/branches/py3k/Doc/library/reprlib.rst	(original)
+++ python/branches/py3k/Doc/library/reprlib.rst	Fri May 16 20:15:12 2008
@@ -1,6 +1,6 @@
-
 :mod:`reprlib` --- Alternate :func:`repr` implementation
-=====================================================
+========================================================
+
 
 .. module:: reprlib
    :synopsis: Alternate repr() implementation with size limits.

Modified: python/branches/py3k/Doc/library/shutil.rst
==============================================================================
--- python/branches/py3k/Doc/library/shutil.rst	(original)
+++ python/branches/py3k/Doc/library/shutil.rst	Fri May 16 20:15:12 2008
@@ -73,8 +73,9 @@
 
 .. 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])

Modified: python/branches/py3k/Lib/test/test_enumerate.py
==============================================================================
--- python/branches/py3k/Lib/test/test_enumerate.py	(original)
+++ python/branches/py3k/Lib/test/test_enumerate.py	Fri May 16 20:15:12 2008
@@ -138,6 +138,8 @@
         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)

Modified: python/branches/py3k/Lib/test/test_generators.py
==============================================================================
--- python/branches/py3k/Lib/test/test_generators.py	(original)
+++ python/branches/py3k/Lib/test/test_generators.py	Fri May 16 20:15:12 2008
@@ -927,7 +927,7 @@
 >>> 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

Modified: python/branches/py3k/Lib/test/test_genexps.py
==============================================================================
--- python/branches/py3k/Lib/test/test_genexps.py	(original)
+++ python/branches/py3k/Lib/test/test_genexps.py	Fri May 16 20:15:12 2008
@@ -92,7 +92,7 @@
 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
 

Deleted: python/branches/py3k/Lib/test/test_repr.py
==============================================================================
--- python/branches/py3k/Lib/test/test_repr.py	Fri May 16 20:15:12 2008
+++ (empty file)
@@ -1,312 +0,0 @@
-"""
-  Test cases for the repr module
-  Nick Mathewson
-"""
-
-import sys
-import os
-import shutil
-import unittest
-
-from test.test_support import run_unittest
-from reprlib import repr as r # Don't shadow builtin repr
-from reprlib import Repr
-
-
-def nestedTuple(nesting):
-    t = ()
-    for i in range(nesting):
-        t = (t,)
-    return t
-
-class ReprTests(unittest.TestCase):
-
-    def test_string(self):
-        eq = self.assertEquals
-        eq(r("abc"), "'abc'")
-        eq(r("abcdefghijklmnop"),"'abcdefghijklmnop'")
-
-        s = "a"*30+"b"*30
-        expected = repr(s)[:13] + "..." + repr(s)[-14:]
-        eq(r(s), expected)
-
-        eq(r("\"'"), repr("\"'"))
-        s = "\""*30+"'"*100
-        expected = repr(s)[:13] + "..." + repr(s)[-14:]
-        eq(r(s), expected)
-
-    def test_tuple(self):
-        eq = self.assertEquals
-        eq(r((1,)), "(1,)")
-
-        t3 = (1, 2, 3)
-        eq(r(t3), "(1, 2, 3)")
-
-        r2 = Repr()
-        r2.maxtuple = 2
-        expected = repr(t3)[:-2] + "...)"
-        eq(r2.repr(t3), expected)
-
-    def test_container(self):
-        from array import array
-        from collections import deque
-
-        eq = self.assertEquals
-        # Tuples give up after 6 elements
-        eq(r(()), "()")
-        eq(r((1,)), "(1,)")
-        eq(r((1, 2, 3)), "(1, 2, 3)")
-        eq(r((1, 2, 3, 4, 5, 6)), "(1, 2, 3, 4, 5, 6)")
-        eq(r((1, 2, 3, 4, 5, 6, 7)), "(1, 2, 3, 4, 5, 6, ...)")
-
-        # Lists give up after 6 as well
-        eq(r([]), "[]")
-        eq(r([1]), "[1]")
-        eq(r([1, 2, 3]), "[1, 2, 3]")
-        eq(r([1, 2, 3, 4, 5, 6]), "[1, 2, 3, 4, 5, 6]")
-        eq(r([1, 2, 3, 4, 5, 6, 7]), "[1, 2, 3, 4, 5, 6, ...]")
-
-        # Sets give up after 6 as well
-        eq(r(set([])), "set([])")
-        eq(r(set([1])), "set([1])")
-        eq(r(set([1, 2, 3])), "set([1, 2, 3])")
-        eq(r(set([1, 2, 3, 4, 5, 6])), "set([1, 2, 3, 4, 5, 6])")
-        eq(r(set([1, 2, 3, 4, 5, 6, 7])), "set([1, 2, 3, 4, 5, 6, ...])")
-
-        # Frozensets give up after 6 as well
-        eq(r(frozenset([])), "frozenset([])")
-        eq(r(frozenset([1])), "frozenset([1])")
-        eq(r(frozenset([1, 2, 3])), "frozenset([1, 2, 3])")
-        eq(r(frozenset([1, 2, 3, 4, 5, 6])), "frozenset([1, 2, 3, 4, 5, 6])")
-        eq(r(frozenset([1, 2, 3, 4, 5, 6, 7])), "frozenset([1, 2, 3, 4, 5, 6, ...])")
-
-        # collections.deque after 6
-        eq(r(deque([1, 2, 3, 4, 5, 6, 7])), "deque([1, 2, 3, 4, 5, 6, ...])")
-
-        # Dictionaries give up after 4.
-        eq(r({}), "{}")
-        d = {'alice': 1, 'bob': 2, 'charles': 3, 'dave': 4}
-        eq(r(d), "{'alice': 1, 'bob': 2, 'charles': 3, 'dave': 4}")
-        d['arthur'] = 1
-        eq(r(d), "{'alice': 1, 'arthur': 1, 'bob': 2, 'charles': 3, ...}")
-
-        # array.array after 5.
-        eq(r(array('i')), "array('i', [])")
-        eq(r(array('i', [1])), "array('i', [1])")
-        eq(r(array('i', [1, 2])), "array('i', [1, 2])")
-        eq(r(array('i', [1, 2, 3])), "array('i', [1, 2, 3])")
-        eq(r(array('i', [1, 2, 3, 4])), "array('i', [1, 2, 3, 4])")
-        eq(r(array('i', [1, 2, 3, 4, 5])), "array('i', [1, 2, 3, 4, 5])")
-        eq(r(array('i', [1, 2, 3, 4, 5, 6])),
-                   "array('i', [1, 2, 3, 4, 5, ...])")
-
-    def test_numbers(self):
-        eq = self.assertEquals
-        eq(r(123), repr(123))
-        eq(r(123), repr(123))
-        eq(r(1.0/3), repr(1.0/3))
-
-        n = 10**100
-        expected = repr(n)[:18] + "..." + repr(n)[-19:]
-        eq(r(n), expected)
-
-    def test_instance(self):
-        eq = self.assertEquals
-        i1 = ClassWithRepr("a")
-        eq(r(i1), repr(i1))
-
-        i2 = ClassWithRepr("x"*1000)
-        expected = repr(i2)[:13] + "..." + repr(i2)[-14:]
-        eq(r(i2), expected)
-
-        i3 = ClassWithFailingRepr()
-        eq(r(i3), ("<ClassWithFailingRepr instance at %x>"%id(i3)))
-
-        s = r(ClassWithFailingRepr)
-        self.failUnless(s.startswith("<class "))
-        self.failUnless(s.endswith(">"))
-        self.failUnless(s.find("...") in [12, 13])
-
-    def test_lambda(self):
-        self.failUnless(repr(lambda x: x).startswith(
-            "<function <lambda"))
-        # XXX anonymous functions?  see func_repr
-
-    def test_builtin_function(self):
-        eq = self.assertEquals
-        # Functions
-        eq(repr(hash), '<built-in function hash>')
-        # Methods
-        self.failUnless(repr(''.split).startswith(
-            '<built-in method split of str object at 0x'))
-
-    def test_range(self):
-        eq = self.assertEquals
-        eq(repr(range(1)), 'range(0, 1)')
-        eq(repr(range(1, 2)), 'range(1, 2)')
-        eq(repr(range(1, 4, 3)), 'range(1, 4, 3)')
-
-    def test_nesting(self):
-        eq = self.assertEquals
-        # everything is meant to give up after 6 levels.
-        eq(r([[[[[[[]]]]]]]), "[[[[[[[]]]]]]]")
-        eq(r([[[[[[[[]]]]]]]]), "[[[[[[[...]]]]]]]")
-
-        eq(r(nestedTuple(6)), "(((((((),),),),),),)")
-        eq(r(nestedTuple(7)), "(((((((...),),),),),),)")
-
-        eq(r({ nestedTuple(5) : nestedTuple(5) }),
-           "{((((((),),),),),): ((((((),),),),),)}")
-        eq(r({ nestedTuple(6) : nestedTuple(6) }),
-           "{((((((...),),),),),): ((((((...),),),),),)}")
-
-        eq(r([[[[[[{}]]]]]]), "[[[[[[{}]]]]]]")
-        eq(r([[[[[[[{}]]]]]]]), "[[[[[[[...]]]]]]]")
-
-    def test_cell(self):
-        # XXX Hmm? How to get at a cell object?
-        pass
-
-    def test_descriptors(self):
-        eq = self.assertEquals
-        # method descriptors
-        eq(repr(dict.items), "<method 'items' of 'dict' objects>")
-        # XXX member descriptors
-        # XXX attribute descriptors
-        # XXX slot descriptors
-        # static and class methods
-        class C:
-            def foo(cls): pass
-        x = staticmethod(C.foo)
-        self.failUnless(repr(x).startswith('<staticmethod object at 0x'))
-        x = classmethod(C.foo)
-        self.failUnless(repr(x).startswith('<classmethod object at 0x'))
-
-    def test_unsortable(self):
-        # Repr.repr() used to call sorted() on sets, frozensets and dicts
-        # without taking into account that not all objects are comparable
-        x = set([1j, 2j, 3j])
-        y = frozenset(x)
-        z = {1j: 1, 2j: 2}
-        r(x)
-        r(y)
-        r(z)
-
-def touch(path, text=''):
-    fp = open(path, 'w')
-    fp.write(text)
-    fp.close()
-
-class LongReprTest(unittest.TestCase):
-    def setUp(self):
-        longname = 'areallylongpackageandmodulenametotestreprtruncation'
-        self.pkgname = os.path.join(longname)
-        self.subpkgname = os.path.join(longname, longname)
-        # Make the package and subpackage
-        shutil.rmtree(self.pkgname, ignore_errors=True)
-        os.mkdir(self.pkgname)
-        touch(os.path.join(self.pkgname, '__init__.py'))
-        shutil.rmtree(self.subpkgname, ignore_errors=True)
-        os.mkdir(self.subpkgname)
-        touch(os.path.join(self.subpkgname, '__init__.py'))
-        # Remember where we are
-        self.here = os.getcwd()
-        sys.path.insert(0, self.here)
-
-    def tearDown(self):
-        actions = []
-        for dirpath, dirnames, filenames in os.walk(self.pkgname):
-            for name in dirnames + filenames:
-                actions.append(os.path.join(dirpath, name))
-        actions.append(self.pkgname)
-        actions.sort()
-        actions.reverse()
-        for p in actions:
-            if os.path.isdir(p):
-                os.rmdir(p)
-            else:
-                os.remove(p)
-        del sys.path[0]
-
-    def test_module(self):
-        eq = self.assertEquals
-        touch(os.path.join(self.subpkgname, self.pkgname + '.py'))
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
-        eq(repr(areallylongpackageandmodulenametotestreprtruncation),
-           "<module '%s' from '%s'>" % (areallylongpackageandmodulenametotestreprtruncation.__name__, areallylongpackageandmodulenametotestreprtruncation.__file__))
-        eq(repr(sys), "<module 'sys' (built-in)>")
-
-    def test_type(self):
-        eq = self.assertEquals
-        touch(os.path.join(self.subpkgname, 'foo.py'), '''\
-class foo(object):
-    pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo
-        eq(repr(foo.foo),
-               "<class '%s.foo'>" % foo.__name__)
-
-    def test_object(self):
-        # XXX Test the repr of a type with a really long tp_name but with no
-        # tp_repr.  WIBNI we had ::Inline? :)
-        pass
-
-    def test_class(self):
-        touch(os.path.join(self.subpkgname, 'bar.py'), '''\
-class bar:
-    pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
-        # Module name may be prefixed with "test.", depending on how run.
-        self.assertEquals(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
-
-    def test_instance(self):
-        touch(os.path.join(self.subpkgname, 'baz.py'), '''\
-class baz:
-    pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import baz
-        ibaz = baz.baz()
-        self.failUnless(repr(ibaz).startswith(
-            "<%s.baz object at 0x" % baz.__name__))
-
-    def test_method(self):
-        eq = self.assertEquals
-        touch(os.path.join(self.subpkgname, 'qux.py'), '''\
-class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
-    def amethod(self): pass
-''')
-        from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import qux
-        # Unbound methods first
-        self.failUnless(repr(qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod).startswith(
-        '<function amethod'))
-        # Bound method next
-        iqux = qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
-        self.failUnless(repr(iqux.amethod).startswith(
-            '<bound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod of <%s.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa object at 0x' \
-            % (qux.__name__,) ))
-
-    def test_builtin_function(self):
-        # XXX test built-in functions and methods with really long names
-        pass
-
-class ClassWithRepr:
-    def __init__(self, s):
-        self.s = s
-    def __repr__(self):
-        return "ClassWithRepr(%r)" % self.s
-
-
-class ClassWithFailingRepr:
-    def __repr__(self):
-        raise Exception("This should be caught by Repr.repr_instance")
-
-
-def test_main():
-    run_unittest(ReprTests)
-    if os.name != 'mac':
-        run_unittest(LongReprTest)
-
-
-if __name__ == "__main__":
-    test_main()

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Fri May 16 20:15:12 2008
@@ -39,7 +39,11 @@
 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
 -------

Modified: python/branches/py3k/Modules/cmathmodule.c
==============================================================================
--- python/branches/py3k/Modules/cmathmodule.c	(original)
+++ python/branches/py3k/Modules/cmathmodule.c	Fri May 16 20:15:12 2008
@@ -920,7 +920,7 @@
 	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

Modified: python/branches/py3k/Modules/fcntlmodule.c
==============================================================================
--- python/branches/py3k/Modules/fcntlmodule.c	(original)
+++ python/branches/py3k/Modules/fcntlmodule.c	Fri May 16 20:15:12 2008
@@ -510,6 +510,9 @@
         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

Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c	(original)
+++ python/branches/py3k/Modules/posixmodule.c	Fri May 16 20:15:12 2008
@@ -7212,6 +7212,11 @@
 #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;

Modified: python/branches/py3k/Objects/enumobject.c
==============================================================================
--- python/branches/py3k/Objects/enumobject.c	(original)
+++ python/branches/py3k/Objects/enumobject.c	Fri May 16 20:15:12 2008
@@ -217,7 +217,10 @@
 	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__"))

Modified: python/branches/py3k/Objects/genobject.c
==============================================================================
--- python/branches/py3k/Objects/genobject.c	(original)
+++ python/branches/py3k/Objects/genobject.c	Fri May 16 20:15:12 2008
@@ -285,7 +285,7 @@
 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);
 }


More information about the Python-3000-checkins mailing list