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


Groups > comp.lang.python > #20343

Re: Read-only attribute in module

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <mateusz@loskot.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:module': 0.04; 'defines': 0.07; 'mess': 0.07; 'run,': 0.07; 'terry': 0.07; 'python': 0.08; 'context:': 0.09; 'function:': 0.09; 'am,': 0.12; 'library': 0.13; 'nabble.com.': 0.16; 'received:192.168.236': 0.16; 'received:216.139': 0.16; 'received:216.139.236': 0.16; 'received:nabble.com': 0.16; 'reedy': 0.16; 'terry,': 0.16; 'url:nabble': 0.16; 'wrote:': 0.18; 'archive': 0.21; 'wrote': 0.21; 'header:In-Reply-To:1': 0.22; 'once.': 0.23; 'library.': 0.24; 'otherwise,': 0.25; 'module': 0.26; 'helpful': 0.26; '-----': 0.28; 'constant': 0.29; 'module.': 0.29; 'keeps': 0.30; 'thanks': 0.32; 'list': 0.32; 'decide': 0.33; 'flag': 0.34; 'to:addr:python-list': 0.35; 'project': 0.35; 'url:python': 0.35; 'charset:us-ascii': 0.37; 'received:192': 0.38; 'could': 0.38; 'some': 0.38; 'think': 0.38; 'option': 0.39; 'that.': 0.39; 'mailing': 0.39; 'everyone': 0.39; 'user': 0.40; 'change': 0.40; 'might': 0.40; 'to:addr:python.org': 0.40; 'your': 0.61; 'view': 0.61; 'else.': 0.67; 'concept': 0.74; 'freeze': 0.84; 'subject:Read': 0.91
Date Mon, 13 Feb 2012 03:57:41 -0800 (PST)
From mloskot <mateusz@loskot.net>
To python-list@python.org
In-Reply-To <jh45p4$trk$1@dough.gmane.org>
References <CABUeae_vv=THd0VLsAteEKu7z8U2KA4p+vK1a=nAeMSKzM-L7g@mail.gmail.com> <jh161s$kqp$1@dough.gmane.org> <1328872312611-4382967.post@n6.nabble.com> <jh45p4$trk$1@dough.gmane.org>
Subject Re: Read-only attribute in module
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5758.1329134265.27778.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1329134265 news.xs4all.nl 6880 [2001:888:2000:d::a6]:59508
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20343

Show key headers only | View raw


Terry Reedy wrote
> 
> On 2/10/2012 6:11 AM, mloskot wrote:
>> The intent of xyz.flag is that it is a value set by the module
>> internally.
>> xyz is a module wrapping a C library.
>> The C library defines concept of a global flag set by the C functions at
>> some events,
>> so user can check value of this flag.
>> I can provide access to it with function: xyz.get_flag()
> 
> If the value of the flag can change during a run, I would do that. 
> Otherwise, you have to make sure the local copy keeps in sync. Users 
> might also think that it is a true constant that they could read once.
> 
> I understand that you might be concerned that one person in a 
> multi-programmer project might decide to rebind xyz.flag and mess up 
> everyone else. I think the real solution might be an option to freeze an 
> entire module.
> 

Terry,

Thanks for your really helpful notes.

Best regards,


-----
-- 
Mateusz Loskot
http://mateusz.loskot.net
--
View this message in context: http://python.6.n6.nabble.com/Read-only-attribute-in-module-tp4378950p4464760.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Read-only attribute in module mloskot <mateusz@loskot.net> - 2012-02-13 03:57 -0800

csiph-web