Apparantly it will (in the 'future') not be possible anymore to use the following:
import numpy as np
np.array([0,1,2]) == None
> False
> FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
This also breaks the lazy loading pattern for numpy arrays:
import numpy as np
def f(a=None):
if a == None:
a = <some default value>
<function body>
What other possibilities allow you to still use lazy initialization?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…