Hacker News new | ask | show | jobs
by fusiongyro 5049 days ago
Interfaces.
3 comments

Abstract base classes. See http://www.doughellmann.com/PyMOTW/abc/
Absent static type checking and manifest typing, abstract base classes do much less than Java interfaces.
Ah yes, the age-old static typing vs duck typing argument.

Sure, in theory static typing can catch bugs. But doing it like Java does it is a lot of work per real bug actually caught.

Whether or not that's true, it is a concrete difference between Python and Java. Python is not a superset of Java.
I never claimed that the two were the same language. My claim was that you can take anything written in Java and pretty much directly translate it to Python.

The fact that there are things Java will flag as errors that a Python translation does not, does not change this fact.

As I said, you seem to be claiming that Python is a superset of Java, not equivalent to it, and that claim is manifestly false. Errors that are detected in one place and not in another are a manifest difference.

Also, Java threads and anonymous classes do not translate directly to Python.

That is a noun. What is the actual use case?
In context, the noun obviously refers to the Java interface syntax.
There's just no need for Interfaces when you have duck-typing at your disposal.
See my remark below.