Le vendredi 08 septembre 2006 09:51, [EMAIL PROTECTED] a écrit :
> Frank Millman, just a short note, more expert people can give you
> better answers. There aren't abstract classes in Python. They are all
> concrete.
Really ? This is like saying there is no singleton in Python...

class AbstractClass(object) :

        def __init__(self) : raise RuntimeError('Ths class is an abstract one 
!')

The abstract class can then define APIs (methods which raise 
NotImplementedError) and/or logic (fully implemented methods).
With this scheme you are not stuck to the "API only" usage of abstract classes 
like in Java nad its interfaces.

> You may have classes with undefined methods (they may raise 
> NotImplementedError).

C++ "pure virtual methods" is only the C++ way of doing something which is a 
more general concept in OOP.


-- 
_____________

Maric Michaud
_____________

Aristote - www.aristote.info
3 place des tapis
69004 Lyon
Tel: +33 426 880 097
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to