[Tutor] interfaces and abstract classes in python

Kent Johnson kent37 at tds.net
Tue Nov 8 13:49:59 CET 2005


Alex Hunsley wrote:
> Alan Gauld wrote:
> 
> 
>>>Interfaces and abstract classes - I know they don't exist per se in 
>>>Python. 
>>
>>
>>First you need to define what you mean by the terms.
>>Every class has an interface - it is the set of messages to which it 
>>responds.
> 
> 
> Yup, I was thinking more in terms of the Java idea, whereby an interface 
> is declared specifically and then a class claiming to implement it 
> causes compilation problems if it doesn't properly implement it.

No, there is nothing like this in Python. This is a form of static type checking which is not part of Python. In general type errors are detected at runtime in Python.
 
> Btw, I notice this email list sends the emails with the originator as 
> the sender, and CC'd to the tutor at python.org address. Is it standard 
> here to reply to the email address of the sender of the message you're 
> replying to, as well as the list itself, or should I be trimming out the 
> sender email and just replying to the list only?

I don't know if it's standard, but I reply just to the list. I see this list as a kind of commons that benefits many, and I want all interactions to be on list. I see my replies as a contribution to the list as much as to the original questioner.

Kent

-- 
http://www.kentsjohnson.com



More information about the Tutor mailing list