Public imports

Benjamin Kaplan benjamin.kaplan at case.edu
Mon Dec 8 13:40:41 EST 2008


On Mon, Dec 8, 2008 at 1:29 PM, Márcio Faustino <m.faustino at gmail.com>wrote:

> So, no chance of doing this:
>
> # "A.py"
> from __future__ import division, with_statement
>
> # "B.py"
> from A import *
> print 1 / 2
>
> ...and printing 0.5, right? Too bad :)
> Thanks!



That would be a very bad idea. What if you did that and then someone else
tried to use your module? However, future imports are a special case. This
will work with any normal import.

>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081208/0c03b88b/attachment-0001.html>


More information about the Python-list mailing list