From: Andy W. <wil...@gm...> - 2012-07-27 19:18:57
|
+1 on the changes On Wed, Jul 25, 2012 at 6:10 PM, Anthony Scopatz <sc...@gm...> wrote: > On Wed, Jul 25, 2012 at 5:48 PM, Maarten Sneep <maa...@xs...>wrote: >> >> >> Although for the example you give here I would prefer to change to >> tb.open(). Namespaces exist for a reason, I think. >> > > This is a good point, and I would be in favor of this rename if other > people were as well... > > If you do a "from tables import *" and the tb.open() overwrites the > builtin open(), you can always regain the builtin by doing "del open". > That said, I agree with you that we shouldn't be 'import *'ing. It sets a > bad example ;) > As a compromise, maybe open() and open_file() could both be defined and equivalent but only add open_file() as part of the module's __all__ list? Namespaces are great but if someone is using import *, they probably don't know that yet and this would be a rude introduction. |