Missing interfaces in Python...

Roy Smith roy at panix.com
Wed Apr 19 10:18:42 EDT 2006


Alex Martelli <aleaxit at yahoo.com> wrote:
>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.

This is true.  This is one of the things Java does well.





More information about the Python-list mailing list