Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #95256
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <kmisoft@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.031 |
| X-Spam-Evidence | '*H*': 0.94; '*S*': 0.00; 'attributes': 0.07; 'everybody!': 0.09; 'python': 0.10; 'anyway': 0.11; '(unlike': 0.16; 'ah,': 0.16; 'api,': 0.16; 'fly': 0.16; 'subject:object': 0.16; 'attribute': 0.18; '>>>': 0.20; 'to:name:python- list@python.org': 0.20; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'looks': 0.29; 'accepts': 0.29; 'arguments,': 0.29; 'subject:/': 0.30; "can't": 0.32; 'class': 0.33; 'subject:like': 0.33; 'thanks!': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'keyword': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'thought': 0.37; 'creation': 0.38; 'does': 0.39; 'system.': 0.39; 'subject:-': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'skip:u 10': 0.61; 'more': 0.63; 'our': 0.64; 'url:app': 0.84; 'subject:looking': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=5g9MXdlU4/TbvY3Lrt4G6wCDsx8jlcc5W/Usks4FErU=; b=rmeq+84SVhuRszCXokBg8MDsR4tJhmonNAhEWOzXIgA6HyM7vC7rUmTI09bExGcUDG jnJBItCDtZLdR2QZBh/1Mu3722nxfuSJnv9/axYCQHlxQ01BZdPDvBmqhbM99fC3j3kd DUyhc6tzqpJ1GSpmHVl/0LQg9DA94SafaosqnfT+vp9iyH4eEYR7tGgxQ3mSHis/ASdL wvKge8Hn3DF/qbTE4PquBD4XDho0MyjARc0P7FW0oh/m+ixlfhJcHdZY6BsSFDfP+fqy EjRHReqpaYvuzB8lR4WBmtHyaZCvbqBt7Da9ZXVCLBNkN4NrRRIwifKOfGVCDLQqSVYl 0fhg== |
| MIME-Version | 1.0 |
| X-Received | by 10.66.142.131 with SMTP id rw3mr55913050pab.141.1439294765215; Tue, 11 Aug 2015 05:06:05 -0700 (PDT) |
| In-Reply-To | <20150811042807.GA56342@cskk.homeip.net> |
| References | <CAPTjJmoLSZjoerPeJ5a+Nh1ftcQfqgdcF-xB=3Xn7m2WKxyjHA@mail.gmail.com> <20150811042807.GA56342@cskk.homeip.net> |
| Date | Tue, 11 Aug 2015 08:06:05 -0400 |
| Subject | Re: looking for standard/builtin dict-like data object |
| From | Vladimir Ignatov <kmisoft@gmail.com> |
| To | "python-list@python.org" <python-list@python.org> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.78.1439294768.3627.python-list@python.org> (permalink) |
| Lines | 23 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1439294768 news.xs4all.nl 2828 [2001:888:2000:d::a6]:44880 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:95256 |
Show key headers only | View raw
>>> I also thought the stdlib had some kind of "namespace" class with this >>> kind >>> of API, but I can't find it now:-( >> >> >> It does - types.SimpleNamespace(). It accepts keyword arguments, and >> will let you create more attributes on the fly (unlike a namedtuple). > > > Yes, that's it. Thanks! > Ah, sad, sad, sad. We unfortunately stuck with built-in Python 2.6.x in our system. I see from docs that SimpleNamespace is rather new creation (3.3+). I know 'namedtuple' way, but don't like it as I prefer freedom in attribute creation/mutation. Looks like I have to stuck with handmade solution for now. Anyway - thanks a lot for everybody! Vladimir https://itunes.apple.com/us/app/python-code-samples/id1025613117
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: looking for standard/builtin dict-like data object Vladimir Ignatov <kmisoft@gmail.com> - 2015-08-11 08:06 -0400
csiph-web