Not possible to hide local variables

Marko Rauhamaa marko at
Thu Apr 30 07:10:34 CEST 2015

Steven D'Aprano <steve+comp.lang.python at>:

> If you have a Java background, you might find this useful:

Unfortunately, I didn't find those articles all that insightful.

The one big difference between Java and Python is interfaces vs
ducktyping. In Java, you do everything through formal interfaces. In
Python, you do nothing through formal interfaces.

I occasionally see a Java class that doesn't implement an interface, and
there are abstract Python base classes that emulate interfaces. However,
I think both practices are nonidiomatic and should be avoided in their
respective domains.

Anonymous nested inner classes are syntactically cumbersome. However,
conceptually they are a fabulous device. They were popularized in Java
and I use them quite frequently in Python.


More information about the Python-list mailing list