Python - How to remove/unimport libs was imported before
Posted
by
Marslo
on Super User
See other posts from Super User
or by Marslo
Published on 2012-09-19T15:20:53Z
Indexed on
2012/09/19
15:43 UTC
Read the original article
Hit count: 207
python
As we know that, in python 2.x, integer would be got if we divide two integer values. However, if using the furture (it's might be a lib or something like that), just like from __future__ import division, we can get float value. E.g.:
>>> 3/2
1
>>> from __future__ import division
>>> 3/2
1.5
>>>
>>>
>>> 3//2
1
>>> 4/3
1.3333333333333333
>>>
So, '//' instead of '/' should be used if getting integer after imported division, but I want to know how to using '/' to get integer again. That is mean, whether there is some way to un-import or remove the libs which was imported before.
© Super User or respective owner