<br><br><div class="gmail_quote">On Tue, Mar 18, 2008 at 8:32 AM, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I don't recall the reason; it may simply be due to the complexity, or<br>
possibly it would have made the _import__ API even uglier.<br>
</blockquote><div><br>I don't recall any such issues, and I can't imagine them now. The '.' is resolved before the fromlist is even considered, and is just a way to find the right package to import from. Importing '*' instead of a set of names should not be a problem.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
I'm fine with removing the restriction; your use case is compelling.<br>
<div><div></div><div class="Wj3C7c"><br>
On Tue, Mar 18, 2008 at 10:23 AM, "Martin v. Löwis" <<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</a>> wrote:<br>
> When I do a relative star import, I current get<br>
><br>
> SyntaxError: 'import *' not allowed with 'from .'<br>
><br>
> What's the reason for this restriction?<br>
><br>
> Is it ok to remove it?<br>
><br>
> I encountered the issue while porting Django. In<br>
> django/newforms/__init__.py, they do<br>
><br>
> from widgets import *<br>
> from fields import *<br>
> from forms import *<br>
> from models import *<br>
><br>
> In 3k, that needs to change to<br>
><br>
> from .widgets import *<br>
> from .fields import *<br>
> from .forms import *<br>
> from .models import *<br>
><br>
> but that still won't work because of the syntax<br>
> error. One solution would be to make the import<br>
> explicit, but that is tedious and unmaintainable.<br>
> E.g. for the widgets line, it would be<br>
><br>
> from .widgets import (Widget, TextInput, PasswordInput,<br>
> HiddenInput, MultipleHiddenInput,<br>
> FileInput, DateTimeInput, Textarea, CheckboxInput,<br>
> Select, NullBooleanSelect, SelectMultiple, RadioSelect,<br>
> CheckboxSelectMultiple, MultiWidget, SplitDateTimeWidget)<br>
><br>
> Regards,<br>
> Martin<br>
> _______________________________________________<br>
> Python-3000 mailing list<br>
> <a href="mailto:Python-3000@python.org">Python-3000@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-3000" target="_blank">http://mail.python.org/mailman/listinfo/python-3000</a><br>
</div></div>> Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/guido%40python.org" target="_blank">http://mail.python.org/mailman/options/python-3000/guido%40python.org</a><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
--Guido van Rossum (home page: <a href="http://www.python.org/%7Eguido/" target="_blank">http://www.python.org/~guido/</a>)<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<br>
Python-3000 mailing list<br>
<a href="mailto:Python-3000@python.org">Python-3000@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-3000" target="_blank">http://mail.python.org/mailman/listinfo/python-3000</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/thomas%40python.org" target="_blank">http://mail.python.org/mailman/options/python-3000/thomas%40python.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!