Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.05; 'raises': 0.07; '22,': 0.09; '"some': 0.16; ':-/': 0.16; 'object()': 0.16; 'received:mail-ig0-x22a.google.com': 0.16; 'value"': 0.16; 'wrote:': 0.16; 'attribute': 0.18; 'pass': 0.22; '2015': 0.23; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'tim': 0.24; 'message-id:@mail.gmail.com': 0.28; 'chase': 0.29; 'subject:other': 0.29; 'fri,': 0.31; 'subject:all': 0.32; 'class': 0.33; 'received:google.com': 0.34; 'to:addr:python-list': 0.35; 'something': 0.35; 'subject:: ': 0.37; 'doing': 0.38; 'wanted': 0.39; 'pm,': 0.39; 'to:addr:python.org': 0.39; 'skip:t 20': 0.40; 'bag': 0.76; 'subject:have': 0.80; 'to:name:python': 0.84; 'subject:you': 0.88 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; bh=p50L/JfAV66AUK/Jb8/nJ3xP/1F2Obs8YhUYn50NPpk=; b=BhrocmQ3id6WF/VvFYTvnB1s97J6ATldYRC36KqWsNLww8mC6jxaa4mDyjx3cKZNPF EJX/ReXvNAll2OevKa64IweNH2DHwpZi0pJTK6x2JqY0VI836Yqh9xkmCqkukG5Ci3kr pP/RAwVn8JfJyursilXPYaV9YxbHnmR+pSc2cHljfGAEL4XdjHpfl5y0gsqLKBkjPg3Y SEA33skJQ9hzv9r+lZS/JVk9shmJK4rhOkr68LoguPaAclogrAphklqd2NV3734mAws2 r51imlKCgQygcLPVF8HidhZk+xqX0a8NMhgFzb9YDGyF/wfDLF1G/weMN1SdW/T5TrrS 6ZsQ== X-Received: by 10.50.30.105 with SMTP id r9mr8292221igh.11.1432329643202; Fri, 22 May 2015 14:20:43 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150522155516.15a6a52d@bigbox.christie.dr> References: <555f440a$0$12990$c3e8da3$5496439d@news.astraweb.com> <201505221914.t4MJE3e9009120@fido.openend.se> <555F84CD.9010204@mrabarnett.plus.com> <87k2w0mjvc.fsf@elektro.pacujo.net> <20150522155516.15a6a52d@bigbox.christie.dr> From: Ian Kelly Date: Fri, 22 May 2015 15:20:02 -0600 Subject: Re: Ah Python, you have spoiled me for all other languages To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432329652 news.xs4all.nl 2873 [2001:888:2000:d::a6]:40176 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91076 On Fri, May 22, 2015 at 2:55 PM, Tim Chase wrote: > I've wondered this on multiple occasions, as I've wanted to just make > an attribute bag and have to do something like > > class AttrBag(object): pass > ab = AttrBag() > ab.x = 42 > ab.y = "some other value" > > because just doing > > ab = object() > > raises the AttributeError Marko highlights. :-/ This is what types.SimpleNamespace is for.