foo = {}.update(os.environ)foo is
None
because the method update
returns None
.You can do this technique with data types, which returns a new copy of them selfs if mutated (str does this).
It's the same pitfall like this:
sorted_list = [1,4,5,6,7,3,2].sort()list.sort() makes an inline sort (mutating the object itself) and returns
None
.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!