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


Groups > comp.lang.python > #73752 > unrolled thread

Re: Creating a dict-like class that counts successful and failed key matches

Started bypython@bdurham.com
First post2014-06-30 12:47 -0400
Last post2014-06-30 12:47 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Creating a dict-like class that counts successful and failed key matches python@bdurham.com - 2014-06-30 12:47 -0400

#73752 — Re: Creating a dict-like class that counts successful and failed key matches

Frompython@bdurham.com
Date2014-06-30 12:47 -0400
SubjectRe: Creating a dict-like class that counts successful and failed key matches
Message-ID<mailman.11347.1404146837.18130.python-list@python.org>
Ethan,

> Keep in mind that dict /will not/ call your overridden methods, so if, for example, you provide your own __getitem__ you 
will also need to provide your own copies of any dict method that calls
__getitem__.

I'm not sure I understand. Are you saying that Chris's __getitem__ will
not be called by other dict methods that would normally call this magic
method and instead call the parent's __getitem__ directly (via super()
or something similar?)?

Is this specific to the native Dict class (because its implemented in C
vs. Python?) or is this behavior more general.

Malcolm

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web