Does Python have C#/Java-style interfaces?
Question: I worked for a few months as a C# programmer, and got used to the idea of
~~generics/templates~~ interfaces, which I could pass to a library without
caring how the object was created.

I'm about to start on a relatively large project, probably in python (I've
written a lot of python before, but mostly my own code for data analysis etc),
and was wondering if there exists a similar concept in this language? I've
tried googling for it and not come up with much.

If the answer's no, that's fine, but in that case what do people generally do
instead?


Answer: > If the answer's no, that's fine, but in that case what do people generally
> do instead?

[Duck Typing](http://c2.com/cgi/wiki?DuckTyping).

What's important is to approach Python by dropping the technical baggage of
C#.

Learn Python as a **new** language. Don't try to map concepts between Python
and C#. That way lies madness.

* * *

> "INTERFACES, not generics, or templates"

Doesn't matter. All that static type declaration technology isn't necessary.
For that matter type casting in order to break the rules isn't necessary
either.

