Re: Populating a dictionary, fast
- From: Ben Finney <bignose+hates-spam@xxxxxxxxxxxxxxx>
- Date: Mon, 12 Nov 2007 09:23:13 +1100
DouhetSukd <DouhetSukd@xxxxxxxxx> writes:
Ah, well, just noticed Ben's suggested this already. Mind you, his
code, while correct in intent, does look a bit fishy (missing those
square brackets)
By "missing those square brackets", what would be a list comprehension
(allocating an entire list in memory at once before proceeding)
becomes a generator expression (generating results from the sequence
only as needed).
Enter 'python "generator expression"' into your favourite search
engine to find out more.
--
\ "What I resent is that the range of your vision should be the |
`\ limit of my action." -- Henry James |
_o__) |
Ben Finney
.
- References:
- Re: Populating a dictionary, fast
- From: Michael Bacarella
- Re: Populating a dictionary, fast
- From: DouhetSukd
- Re: Populating a dictionary, fast
- From: DouhetSukd
- Re: Populating a dictionary, fast
- Prev by Date: Re: Extended date and time
- Next by Date: Re: Extended date and time
- Previous by thread: Re: Populating a dictionary, fast
- Next by thread: Re: Populating a dictionary, fast
- Index(es):
Relevant Pages
|