Hi,
I'm spending hours in understanding why a 'None' appears immediatly after creating a dictionary, leading to a crash afterward (such dictionary is created in a function and returned)
Here is a basic example without any 'None'
Thanks
Paul
I'm spending hours in understanding why a 'None' appears immediatly after creating a dictionary, leading to a crash afterward (such dictionary is created in a function and returned)
Here is a basic example without any 'None'
import numpy as np Mat = np.random.random( (2, 2) ) MyDict = {} print(MyDict) MyDict.update({'Mat': Mat},) DictList = list(MyDict.keys()) def test(A): DefDict = {} print(DefDict) DefDict.update({'A': A}) return DefDict B = test(Mat)
Output:{}
{}
In my real case:RealDict = {} print(RealDict)
Output:{}
None
That's the first time the dictionary is created: any idea to explain from where 'None' comes from?Thanks
Paul