[Tutor] interfaces and abstract classes in python

Alex Hunsley lard at tardis.ed.ac.uk
Tue Nov 8 14:05:51 CET 2005


Kent Johnson wrote:

>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.
>  
>
Yes, I've come to realise this isn't the python way. Just getting my 
head around pythonland.

> 
>  
>
>>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.
>  
>
Oh yes, I'd always reply to the list in the very least; I was really 
just wondering what the etiquette was concerning emails also going back 
to the person you're reply to directly (as well as to the list). I ask 
because the list is set up so that it appears replies are also meant to 
go to the person you're replying to. It would seem to be more sensible 
if the emails sent out to the list had the 'from:' being the list 
address, rather than the actual sender; then hitting plain old reply 
would work (currently I have to hit 'reply all', otherwise it just 
emails the person I'm replying to).

cheers
alex


>Kent
>
>  
>




More information about the Tutor mailing list