python - Import __future__ division does only work if not imported from another file -
this works: (result = 0.01)
from __future__ import division def division_test(): print 10/1000 division_test() this not: (result = 0)
file a:
from __future__ import division file b:
from import * def division_test(): print 10/1000 division_test() why? if put things
import numpy np into file a, can import file b same way , working time.
__future__ imports not quite same others. per the documentation (emphasis mine):
[
__future__] allows use of new features on per-module basis before release in feature becomes standard.
Comments
Post a Comment