[Python-3000] from .foo import *

Jim Jewett jimjjewett at gmail.com
Thu Mar 20 16:02:23 CET 2008


I *think* you already fixed this; if not, I agree it should be fixed.
While import * is not great, I think the alternative is worse.

As you point out, an explicit listing is unmaintainable, and the
alternative is a funky dance to first import that module's __all__,
then import based on that -- which still has all the disadvantanges of
import *.

-jJ

On 3/18/08, "Martin v. Löwis" <martin at v.loewis.de> wrote:

>  but that still won't work because of the syntax
>  error. One solution would be to make the import
>  explicit, but that is tedious and unmaintainable.
>  E.g. for the widgets line, it would be
>
>  from .widgets import (Widget, TextInput, PasswordInput,
>      HiddenInput, MultipleHiddenInput,
>      FileInput, DateTimeInput, Textarea, CheckboxInput,
>      Select, NullBooleanSelect, SelectMultiple, RadioSelect,
>      CheckboxSelectMultiple, MultiWidget, SplitDateTimeWidget)


More information about the Python-3000 mailing list