merits of Lisp vs Python

dixkey at gmail.com dixkey at gmail.com
Sun Dec 10 19:37:34 EST 2006


Steven D'Aprano wrote:
> > from foolib import *
> > bar.bar("somefile")
> >
> > What does this program do? I have no idea. Its functionality is
> > hidden behind multiple layers of abstraction (function, object,
> > library.)
>
> Sure.
>
> But at least you know that foolib is a module or package. You know what
> from and import do, and that can't change. And you know that bar is an
> object with a method also called bar, it is being called, and the
> argument is a string "somefile". Those things can't change. Imagine a
> hypothetical language where those two lines could mean *anything*.

Oh, you mean imagining a hypothetical language like Python? Where bar
might not have a method bar at all? Where it might be a property set to
an intance of a class with __call__ method? Oh where a metaclass for
bar can intercept a request for "bar" property, do *anything* and call
sys.exit() without even getting to the ("somefile") part?
Thanks, it was fun to hear about Python being hypothetical.




More information about the Python-list mailing list