Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'one?': 0.05; 'classes.': 0.09; 'url:activestate': 0.09; 'python': 0.11; '"automatic': 0.16; 'for,': 0.16; 'modifier': 0.16; 'new-style': 0.16; 'old-style': 0.16; 'recipe': 0.16; 'recipes': 0.16; 'subject:dictionaries': 0.16; 'travis': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'alex': 0.19; 'meant': 0.20; 'feb': 0.22; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'url:code': 0.29; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'extending': 0.31; 'keys': 0.31; 'steven': 0.31; 'classes': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'too': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'times': 0.62; 'reached': 0.63; 'delegate': 0.68; '(hint:': 0.84; '2015': 0.84; 'exercise.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=AxFUH7wuzAACOCWyAjmo0/1A4OtpVG8dXBrTvCqHFdg=; b=HMJjdr8aCv2c0NyAL6ZFNUSjsjDEG2hpMrSF/2Xca2isfg7uT3+KfXG5hpX2sERBAQ sALHpsdLyifAvnjUAcG5gHYMxPL0rjS91P29MaXJ4ifeRQax0jQMQh83J/LwqJCeU3Wp I42rdjKCk0xoaPqa7LaOZgpC3awmxH+1Z2sdlUxYPKxZeDYaZArrj+WAFfd2ZyiWnX6x /Kl+3XYNFB1W4V62mU7H3kFf2vu1mGIYJ4xocDeB6eKc/LJ2GDafDb3dJ+4T08sWbfjQ HLMK5UTnH4/MHuwbQ933zXbR7ePpUZATjjkn8eJdRHfzXHnkzldEt9d/qbiGZsmQoqZq Jb2A== X-Received: by 10.68.201.168 with SMTP id kb8mr1162039pbc.89.1423095619481; Wed, 04 Feb 2015 16:20:19 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <54d29f63$0$12986$c3e8da3$5496439d@news.astraweb.com> References: <54d29f63$0$12986$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Wed, 4 Feb 2015 17:19:39 -0700 Subject: Re: pymongo and attribute dictionaries To: Python Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423099055 news.xs4all.nl 2879 [2001:888:2000:d::a6]:51223 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:85242 On Wed, Feb 4, 2015 at 3:38 PM, Steven D'Aprano wrote: > Travis Griggs wrote: >> This just does not roll of the fingers well. Too many =E2=80=9Creach for= modifier >> keys=E2=80=9D in a row. > > *One* modifier key in a row is too many? > > s o m e SHIFT D o c [ ' SHIFT _ i d ' ] I think the point was meant to be the number of keys that need to be reached for, not just the number of times Shift needs to be pressed. > Extending this to wrap methods of classes is also left as an exercise. > (Hint: don't subclass. Search the ActiveState Python recipes for "automat= ic > delegation" by Alex Martelli.) Do you mean this one? http://code.activestate.com/recipes/52295-automatic-delegation-as-an-altern= ative-to-inherita/ That's based on old-style classes. With new-style classes it fails to delegate dunder methods like __str__. That recipe should be considered obsolete.