This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve21
Recipients steve21
Date 2009-08-24.07:33:52
SpamBayes Score 5.1993965e-11
Marked as misclassified No
Message-id <1251099236.05.0.0799674766136.issue6771@psf.upfronthosting.co.za>
In-reply-to
Content
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, ...)
History
Date User Action Args
2009-08-24 07:33:56steve21setrecipients: + steve21
2009-08-24 07:33:56steve21setmessageid: <1251099236.05.0.0799674766136.issue6771@psf.upfronthosting.co.za>
2009-08-24 07:33:54steve21linkissue6771 messages
2009-08-24 07:33:52steve21create