Márcio Faustino a écrit :
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?
Nope, but for totally unrelated reasons (cf Skip's anwer).
OTHO, this is valid:
# foo.py
def bar():
return "ba
Márcio Faustino schrieb:
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 :)
Au contraire - *very* good. If it were otherwise, what would happen to
code that _relies_ on / returning
Márcio> So, no chance of doing this:
Márcio> # "A.py"
Márcio> from __future__ import division, with_statement
Márcio> # "B.py"
Márcio> from A import *
Márcio> print 1 / 2
Márcio> ...and printing 0.5, right? Too bad :)
"from __future__ ..." isn't really an import stat
On Mon, Dec 8, 2008 at 1:29 PM, Márcio Faustino <[EMAIL PROTECTED]>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
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!
--
http://mail.python.org/mailman/listinfo/python-list
> D type system has several big holes,
I meant "D module system", of course. Sorry.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Márcio Faustino:
> Does Python support public imports instead of the default private?
> Something like D's "public import" (see <http://www.digitalmars.com/d/
> 2.0/module.html>) or even Perl's "export_to_level".
D type system has several big holes,
Márcio Faustino a écrit :
Hi,
Does Python support public imports instead of the default private?
Python has no notion of "public" or "private" !-)
Something like D's "public import" (see <http://www.digitalmars.com/d/
2.0/module.html>)
Python imp
Hi,
Does Python support public imports instead of the default private?
Something like D's "public import" (see <http://www.digitalmars.com/d/
2.0/module.html>) or even Perl's "export_to_level".
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list