[Python-Dev] Adding a new class to the library? (original) (raw)

Guido van Rossum guido@beopen.com
Sun, 06 Aug 2000 20:32:59 -0500


I have a candidate for admission to the Python class library. It's a framework class for writing things like menu trees and object browsers. What's the correct approval procedure for such things?

In more detail, it supports manipulating a stack of sequence objects. Each sequence object has an associated selection point (the cirrently selected sequence member) and an associated viewport around it (a range of indices or sequence members that are considered `visible'. There are methods to manipulate the object stack. More importantly, there are functions which move the selection point in the current object around, and drag the viewport with it. (This sort of thing sounds simple, but is tricky for the same reason BitBlt is tricky -- lots of funky boundary cases.) I've used this as the framework for implementing the curses menu interface for CML2. It is well-tested and stable. It might also be useful for implementing other kinds of data browsers in any situation where the concept of limited visibility around a selection point makes sense. Symbolic debuggers is an example that leaps to mind. I am, of course, willing to fully document it.

Have a look at the tree widget in IDLE. That's Tk specific, but I believe there's a lot of GUI independent concepts in there. IDLE's path and object browsers are built on it. How does this compare?

--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)