On Mon, Sep 29, 2014 at 7:52 AM, Steven D'Aprano
wrote:
> Whether you prefer to use setdefault, or a defaultdict, is a matter of
> taste.
There is potentially a significant difference in performance -- with
setdefault, the subordinate data structure is created on every call to
be passed into setd
David Alban wrote:
> greetings,
>
> i'm writing a program to scan a data file. from each line of the data
> file
> i'd like to add something like below to a dictionary. my perl background
> makes me want python to autovivify, but when i do:
>
> file_data = {}
>
> [... as i loop th
On 9/28/14 8:04 PM, David Alban wrote:
i'm writing a program to scan a data file. from each line of the data
file i'd like to add something like below to a dictionary. my perl
background makes me want python to autovivify, but when i do:
file_data = {}
[... as i loop through lin
On Mon, Sep 29, 2014 at 10:04 AM, David Alban wrote:
> file_data = {}
>
> [... as i loop through lines in the file ...]
>
> file_data[ md5sum ][ inode ] = { 'path' : path, 'size' : size, }
>
> what is the pythonic way to build my "file_data" data structure above that
> has th
greetings,
i'm writing a program to scan a data file. from each line of the data file
i'd like to add something like below to a dictionary. my perl background
makes me want python to autovivify, but when i do:
file_data = {}
[... as i loop through lines in the file ...]