New submission from Thomas Wouters: Patch to backport dictviews to trunk. Consists of some trickery:
- new 'viewkeys', 'viewvalues' and 'viewitems' methods of dicts, returning exactly what 'keys', 'values' and 'items' return in 3.0: three new types defined in dictobject.c - a future import (dictviews) that changes which opcodes are generated for (some) attribute access - special opcodes for getting and setting 'keys', 'values' and 'items' attributes from an object. These opcodes do nothing special unless a future import is in effect in the calling code block *and* the type they are called on is a dict subclass, in which case they translate 'keys', 'values' and 'items' to 'viewkeys', 'viewvalues' and 'viewitems'. - similar specialcasing in getattr() and setattr() ---------- components: Interpreter Core files: dictviews_backport.diff keywords: patch messages: 61834 nosy: twouters severity: normal status: open title: Backport dictviews to 2.6 versions: Python 2.6 Added file: http://bugs.python.org/file9320/dictviews_backport.diff __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1967> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com