2 ms·
So its a shortcut that if you pass a variable as a key with no value it automatically creates a key with the same name as the variable and assigns the value? T
by dec0dedab0de 5y ago
So its a shortcut that if you pass a variable as a key with no value it automatically creates a key with the same name as the variable and assigns the value?
That is kind of neat, but I tend to think of a bunch of {'a':a} as a bit of a code smell. Like maybe I should have used the hash/object/dict to begin with
- BiteCode_dev 5y agoIt's mostly useful when a function generates values then return them as a dict or when things are parts in different chained calculations before being included in the dict to save lookups.