The Artima Developer Community
Sponsored Link

Python's Design Goals
A Conversation with Guido van Rossum, Part II
by Bill Venners
January 20, 2003

<<  Page 3 of 4  >>


Python and Large Applications

Bill Venners: Have you seen problems with Python scaling up to apps the size of Zope? Is there a limit? You said originally you thought 500 lines would be a big Python program.

Guido van Rossum: That was just my lack of imagination. The only thing we had to add to the language, at some point, was a new structuring mechanism on top of modules. The number of modules started proliferating and every user started creating large numbers of their own modules, and it was clear that there would be namespace conflicts. So we said we'd make it easy to group modules together in a package. And again, it uses similar syntax to Java, although the way it works and the details of the syntax are slightly different. However, it gives you the same hierarchical namespace of modules inside subpackages inside packages; you can go as deep or as shallow as you want. That's really the only thing we did to support writing larger programs.

Before I joined Zope, the people there implemented a few data structures that they needed in C, which is a legitimate use of making extensions to Python in C. They implemented the persistency mechanism with a transactional object database and all that wonderful stuff on top of some C code, and all the implementation details were then done in Python. They also introduced—I think as a means to support writing larger programs—the concept of interfaces, which is not entirely different from Java interfaces. Although they were done as a user add-on, the syntax is not ideal, but the functionality is complete. You can say this class implements this interface, or groups of interfaces. You can then test instances of that class to see if they really do conform to the protocol defined by the interface. You can define interfaces. Your interfaces can inherit from each other to structure your interfaces.

<<  Page 3 of 4  >>

Sponsored Links

Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use