On Fri, 10 Dec 1999, Fred L. Drake, Jr. wrote:
Greg Stein writes:
No need to do a new type. Just wrap the DIR* into a PyCObject. Add a magic number if you're worried about mixing CObjects.
That's certainly one option, but I would have made readdir(), seekdir(), rewinddir() and closedir() into the methods read(), seek(), rewind() and close(). So it's a question of what interface you prefer; functions with magically interpreted token parameters (kind of like file descriptors, hey!), or something that is more recognizably object-oriented. I know my preference. ;-)
Well, I know my preference of those two alternatives, too :-), but if we're going with the Pythonic minimalism, then I'd think you would expose the functions "as close as possible." Would I argue if you went with a method-based approach? No :-) Cheers, -g -- Greg Stein, http://www.lyra.org/