Namespace pollution

Dirk-Ulrich Heise hei at adtranzsig.de
Tue Feb 1 14:36:48 CET 2000


Moshe Zadka schrieb in Nachricht ...
>Use OO -- classes were meant
>exactly to reduce namespace clutter by keeping the functions "inside" the
>objects.

Ahem. No, that's not the reason to define a class. I mean, maybe it's
a reason for you, but not for me.

Anyway, the thread revealed some interesting points.
I was close to finding the "nested functions" thing acceptable until
i read

[Terry Reedy]
> The problem with this is that function X is recreated everytime you call
> function Y.

So, the only remaining solution without a runtime penalty
for not cluttering a classes interface (yes,
i do use classes) is to define them "__" methods.

I find that ugly, so i'll stick to my overly lengthy functions and methods.
(which are not a real problem with a folding editor and a 2-space
indentation)

--
Dipl.Inform. Dirk-Ulrich Heise
hei at adtranzsig.de
dheise at debitel.net







More information about the Python-list mailing list