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 terry.reedy
Recipients georg.brandl, terry.reedy
Date 2008-11-17.20:14:17
SpamBayes Score 3.6183992e-06
Marked as misclassified No
Message-id <1226952859.0.0.283857665516.issue4339@psf.upfronthosting.co.za>
In-reply-to
Content
I see two problems with the current (.rc2) doc on "Dictionary view
objects" that are set-like.

1. The first paragraph of the section ends with the fragment

"The keys and items views have a set-like character since their entries"

This is not only incomplete, but wrong.  Items views are set-like
(entries are unique and hashable) only if all values are hashable, as
revealed way at the end in a 'warning' that is only needed because of
the previous over-generalization.  I recommend that this fragment, the
one sentence after the 'x in dictview' entry, and the warning be
combined into one paragraph that tells the complete story at the
appropriate place, which is where the 'one sentence' is now.

"Keys views are set-like since their entries are unique and hashable. 
If all values are hashable, so that (key,value) pairs are unique and
hashable, then an items view is also set-like.  (Values views are not
treated as set-like since the entries are generally not unique.) Let
'set-view' and 'other' each be a set or set-like view.  Then the
following set operations are available."

This suggestion also addresses the second problem I see.  The set
operations are symmetric, but 'dictview op other' is not.  It excludes
the valid combination 'set op dictview'.  So I think all 4 ops should be
listed as 'set-view op other' instead, after the revised introduction above.
History
Date User Action Args
2008-11-17 20:14:19terry.reedysetrecipients: + terry.reedy, georg.brandl
2008-11-17 20:14:19terry.reedysetmessageid: <1226952859.0.0.283857665516.issue4339@psf.upfronthosting.co.za>
2008-11-17 20:14:18terry.reedylinkissue4339 messages
2008-11-17 20:14:17terry.reedycreate