On Thu, Jun 17, 2010 at 01:52:58PM +0530, Srinivas Reddy Thatiparthy wrote:
> is it just because of duck typing we don't require a concept of > interfaces(like in Java and C#) in python? i think so.what you say? Conceptually they are bit different. I am assuming you meant Dynamic typing (wherein Duck typing a sub-concept) and then Interfaces. You can positively argue that Dynamically typed languages may not need Interfaces. But that has not really been a strong case. Like zope.interface example over which you can define your class blueprint. Well, I have used it (as twisted uses it) but I don't know the specific requirements for it (and I believe that you can work without it though in a not-so-structured way). Also, with respect to duck-typing where 'hasattr' plays a important role, there seems to have been concerns that it is limited and much deeper object inspection techniques are required, like deeper information from issubclass and isinstance methods. For those reasons, Abstract Base classes, which kind of provide some Interfaces have come in Python. http://docs.python.org/glossary.html#term-abstract-base-class The last para was from my theoretical understanding, I am yet to write programs/projects which would need those concepts. -- Senthil Here I am in 53 B.C. and all I want is a dill pickle!! _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers