New submission from steve21 <steve872929...@yahoo.com.au>: The documentation and implementation disagree.
Documentation: "Module curses.wrapper Convenience function to ensure proper terminal setup and resetting on application entry and exit. ... 15.10. curses.wrapper — Terminal handler for curses programs This module supplies one function, wrapper() ... curses.wrapper.wrapper(func, ...) Wrapper function that initializes curses .. " Implementation: $ python3.1 Python 3.1.1 (r311:74480, Aug 24 2009, 14:50:57) [GCC 4.4.0 20090506 (Red Hat 4.4.0-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import curses.wrapper as cw >>> cw.wrapper Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'function' object has no attribute 'wrapper' The 'curses.wrapper.wrapper' function no longer exists. The 'curses.wrapper' module no longer exists, the module is now a function. The problem is the line from curses.wrapper import wrapper in curses/__init__.py - curses has clobbered its own namespace and made the curses.wrapper module inaccessible. Instead of this tortuous sequence of module hiding and namespace clobbering it would be simpler to just place the curses.wrapper.wrapper function in curses/__init__.py and do away with the need for the curses.wrapper single-function-module. And update the docs so: references to the curses.wrapper module are removed the function curses.wrapper.wrapper(func, ...) becomes curses.wrapper.(func, ...) ---------- components: Library (Lib) messages: 91903 nosy: steve21 severity: normal status: open title: documentation/implementation error versions: Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6771> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com