This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients alexandre.vassalotti, belopolsky, eric.araujo, grubert, jackdied, rhettinger, schmir, zzzeek
Date 2010-07-16.00:57:02
SpamBayes Score 2.5841084e-06
Marked as misclassified No
Message-id <>
In-reply-to <>
On Thu, Jul 15, 2010 at 8:26 PM, mike bayer <> wrote:
> where is it defined that sets are not "supposed" to contain mutable items?   such a requirement vastly limits the usefulness of sets.

Well, there is no such requirement. The actual requirement is that
they should be hashable.  For built-in types, however hashable is the
same as immutable.  Arguably, user-defined classes should emulate

> Consider that relational database rows are mutable.  A result set containing multiple rows which each have a primary key comprises a set, hashed on primary key.  But other attributes of each row can be updated.   Surely this is not controversial ?  What Python data structure should I (and a whole bunch of Python ORMs) be using to represent mutable, relational database rows, unordered and unique on primary key, in memory ?

Why wouldn't you represent a result set as a dict mapping primary key
(tuple) to list of column values?
Date User Action Args
2010-07-16 00:57:04belopolskysetrecipients: + belopolsky, rhettinger, grubert, jackdied, alexandre.vassalotti, schmir, eric.araujo, zzzeek
2010-07-16 00:57:03belopolskylinkissue9269 messages
2010-07-16 00:57:02belopolskycreate