Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5079

Re: Dictionary Views -- good examples? [was Re: Python 3 dict question]

Date 2011-05-10 10:18 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: Dictionary Views -- good examples? [was Re: Python 3 dict question]
References (1 earlier) <mailman.1262.1304711497.9059.python-list@python.org> <777641c8-4928-4e49-832a-6a4a076628d1@o26g2000vby.googlegroups.com> <BANLkTimo-LZShj2UwB0VEoRn2F14qtYgRg@mail.gmail.com> <4DC47B04.9070007@stoneleaf.us> <BANLkTimktZQsY7-oQa+zFq9wjt-KhM3i2g@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1384.1305047221.9059.python-list@python.org> (permalink)

Show all headers | View raw


Ian Kelly wrote:
> On Fri, May 6, 2011 at 4:49 PM, Ethan Furman wrote:
>> Anybody care to chime in with their usage of this construct?
> 
> You should start with PEP 3106.  The main idea is that dict.keys() and
> dict.items() can be treated as frozensets, while still being more
> lightweight than lists.  That lets you do nifty things like "a.keys()
> == b.keys()" which, if a and b are Python 3 dicts, will tell you
> whether they contain the same keys.

Cool, thanks.

~Ethan~

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Python 3 dict question dmitrey <dmitrey15@gmail.com> - 2011-05-06 12:40 -0700
  Re: Python 3 dict question Chris Rebert <clp2@rebertia.com> - 2011-05-06 12:51 -0700
    Re: Python 3 dict question dmitrey <dmitrey15@gmail.com> - 2011-05-06 12:57 -0700
      Re: Python 3 dict question Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-06 14:48 -0600
      Dictionary Views -- good examples?  [was Re: Python 3 dict question] Ethan Furman <ethan@stoneleaf.us> - 2011-05-06 15:49 -0700
        Re: Dictionary Views -- good examples?  [was Re: Python 3 dict question] Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-05-07 21:09 +1200
          Re: Dictionary Views -- good examples?  [was Re: Python 3 dict question] Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-05-08 11:23 +0200
      Re: Dictionary Views -- good examples? [was Re: Python 3 dict question] Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-06 18:23 -0600
      Re: Dictionary Views -- good examples? [was Re: Python 3 dict question] Ethan Furman <ethan@stoneleaf.us> - 2011-05-10 10:18 -0700
  Re: Python 3 dict question Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-06 14:02 -0600
  Re: Python 3 dict question Rob Wolfe <rw@smsnet.pl> - 2011-05-06 22:46 +0200
  Re: Python 3 dict question nirinA raseliarison <nirina.raseliarison@gmail.com> - 2011-05-06 14:18 -0700
  Re: Python 3 dict question Raymond Hettinger <python@rcn.com> - 2011-05-10 10:25 -0700

csiph-web