About one class/function per module

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Sun Nov 1 23:01:12 EST 2009


On Sun, 01 Nov 2009 18:33:57 -0800, alex23 wrote:

> Peng Yu <pengyu... at gmail.com> wrote:
>> So I am asking disadvantages besides python import mechanism is not
>> friendly to it.
> 
> Which part of "name collisions have to be resolved somehow" isn't
> explicit enough for you?
> 
> You can't keep saying "this works in C++" while refusing to accept that
> this is an implementation decision with Python.

Oh, it doesn't work to Peng Yu's satisfaction in C++ either. In an 
earlier email, he wrote:


"I'm not complaining. I just wish there is a walkaround. In C++, I
still have to write some script to make sure the directory hierarchy
is consistent with the namespace, because C++ doesn't impose the
constraint that the directory hierarchy is the same as the namespace.
But it seems that is no such walkaround in python for my case, because
python binds namespace to directory hierarchy."

You got that? In Python, which forces the namespace and directory 
hierarchy to be the same, he wants them to be independent; in C++, which 
relaxes that restriction, he writes scripts to force them to be the same.


[Aside: the word is "work-around" not "walk-around". Easy mistake to 
make.]



-- 
Steven



More information about the Python-list mailing list