Re: Large Dictionaries
- From: bearophileHUGS@xxxxxxxxx
- Date: 15 May 2006 13:59:16 -0700
Roy Smith:
I am befuddled as to why
people thought creating a dict by keyword would be a useful thing to
do, but left out (and, indeed, eliminated the chance to add the syntax
later) the obviously useful ability to hint at the size.
Adding the keyword syntax doesn't require much memory to a Python
programmer because it's the same syntax used elsewhere. While adding
another different method to dicts increases their API. Python is
usually designed to have smaller APIs, to help programmers remember
most things.
I agree that a reserve method to Python dicts/sets can be a little
useful, but Python programmers are usually more concerned about doing
things in a short programmer time and short code space, than telling
the computer how to do such things in the faster way (C++ is more for
speed so the reserve of the STL hashes can be more useful).
Bye,
bearophile
.
- References:
- Large Dictionaries
- From: Chris Foote
- Re: Large Dictionaries
- From: Roy Smith
- Re: Large Dictionaries
- From: Aahz
- Re: Large Dictionaries
- From: Roy Smith
- Large Dictionaries
- Prev by Date: RE: Iterating generator from C (PostgreSQL's pl/python RETUN SETOF/RECORD iterator support broken on RedHat buggy libs)
- Next by Date: Re: Test professionalism (was: count items in generator)
- Previous by thread: Re: Large Dictionaries
- Next by thread: Re: Large Dictionaries
- Index(es):
Relevant Pages
|