Python 3: dict & dict.keys()

Chris Angelico rosuav at gmail.com
Thu Jul 25 02:02:42 EDT 2013


On Thu, Jul 25, 2013 at 3:48 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Dicts aren't sets, and don't support set methods:
>
> py> d1 - d2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: unsupported operand type(s) for -: 'dict' and 'dict'

I wouldn't take this as particularly significant, though. A future
version of Python could add that support (and it might well be very
useful), without breaking any of the effects of views.

ChrisA



More information about the Python-list mailing list