interfaces?
Chris Tavares
ctavares at develop.com
Sun Feb 4 05:38:24 EST 2001
More information about the Python-list mailing list
Sun Feb 4 05:38:24 EST 2001
- Previous message (by thread): interfaces?
- Next message (by thread): interfaces?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
<drewpc at colorado.edu> wrote in message news:95ckj2$dlc$1 at nnrp1.deja.com... > Let me preface this posting by saying that I'm not a fan of Java. A lot > of people may argue with me, but that's not the point. The point is > that I think that, one of the only useful features of Java is the idea > of an interface. > [... snip ...] I think that the Smalltalk approach to interfaces would be more appropriate for Python than the Java one - dynamic vs. static and all. The equivalent code in Python would be: class IDontDoAnything: def UselessMethod(self): return self.SubclassResponsibility() And then you don't define SubclassResponsibility. That way, when you try and call UselessMethod on a class that doesn't implement it, you'll get an attribute error. Static verification doesn't really belong in Python to my mind. I *like* just being able to only implement the part of the protocol that I need. -Chris
- Previous message (by thread): interfaces?
- Next message (by thread): interfaces?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list