re-import aliased/shadowed python built-in methods

前端 未结 2 460
眼角桃花
眼角桃花 2021-01-04 09:54

If one has run

from numpy import *

then the built-in all, and several other functions, are shadowed by numpy fun

2条回答
  •  难免孤独
    2021-01-04 10:50

    You can correct these en masse by re-importing the builtins:

    In [1]: all
    Out[1]: 
    
    In [2]: from numpy import *
    
    In [3]: all
    Out[3]: 
    
    In [4]: from __builtin__ import *
    
    In [5]: all
    Out[5]: 
    

提交回复
热议问题