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


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

Re: Read-only attribute in module

Started byTerry Reedy <tjreedy@udel.edu>
First post2012-02-10 17:29 -0500
Last post2012-02-10 17:29 -0500
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: Read-only attribute in module Terry Reedy <tjreedy@udel.edu> - 2012-02-10 17:29 -0500

#20198 — Re: Read-only attribute in module

FromTerry Reedy <tjreedy@udel.edu>
Date2012-02-10 17:29 -0500
SubjectRe: Read-only attribute in module
Message-ID<mailman.5684.1328913015.27778.python-list@python.org>
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 Jan Reedy

[toc] | [standalone]


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


csiph-web