Missing interfaces in Python...

Alex Martelli aleaxit at yahoo.com
Wed Apr 19 10:12:30 EDT 2006


Roy Smith <roy at panix.com> wrote:
   ...
> > A class asserting, e.g., "implements IPainter", doesn't thereby risk
> > being accidentally misused where an IGunslinger is required (OTOH,
> > implementing >1 of these IS a bother, but that's sort of inevitable).
> 
> I suppose, but all you've really done is move the problem to a different
> namespace.  Which IPainter did you have in mind?  The one that has to do
> with people who apply oils to canvas, or the one that has to do with ropes
> that are used to tie up rowboats?

In Java's excellent naming convention for modules, there's no ambiguity:
I specifically requested it.aleax.artists.IPainter, or else specifically
requested com.panix.roy.boating.IPainter -- nothing stops any language
with a structured namespace for modules from using that convention.


Alex



More information about the Python-list mailing list