[SciPy-user] How to solve name mangling ?

Matthieu Brucher matthieu.brucher at gmail.com
Fri Jun 8 08:23:26 EDT 2007


>
> Now I get my N-less "array".
> So I probably shouldn't have followed my friends advice,
> and I should just have written
>
>     import my_friends_module



This is the correct way of doing things


Another solution could be, but don't know if it's safe enough
>
>     from my_friends_module import *
>     # and always as the last import do my own
>     from scipy import array
>
> Is this a good solution ?


No because when you'll want to use array, which array is it really ?
What is more, there can be border effects in your friend's module, there
shouldn't be, but how to be sure ?

Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20070608/51d8092c/attachment.html>


More information about the SciPy-User mailing list