Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20152
| References | <mailman.5583.1328787848.27778.python-list@python.org> <878vkc426c.fsf@benfinney.id.au> <4f346d28$0$29986$c3e8da3$5496439d@news.astraweb.com> <jh22s8$nrp$1@dough.gmane.org> |
|---|---|
| Date | 2012-02-10 10:09 +0000 |
| Subject | Re: Read-only attribute in module |
| From | Arnaud Delobelle <arnodel@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5646.1328868568.27778.python-list@python.org> (permalink) |
On 10 February 2012 03:27, Terry Reedy <tjreedy@udel.edu> wrote: > On 2/9/2012 8:04 PM, Steven D'Aprano wrote: > >> Python happily violates "consenting adults" all over the place. We have >> properties, which can easily create read-only and write-once attributes. > > > So propose that propery() work at module level, for module attributes, as > well as for class attributes. I think Steven would like something else: bare names that cannot be rebound. E.g. something like: >>> const a = 42 >>> a = 7 Would raise an exception. Is that right? -- Arnaud
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Read-only attribute in module Mateusz Loskot <mateusz@loskot.net> - 2012-02-09 11:43 +0000
Re: Read-only attribute in module Ben Finney <ben+python@benfinney.id.au> - 2012-02-09 23:32 +1100
Re: Read-only attribute in module mloskot <mateusz@loskot.net> - 2012-02-09 08:44 -0800
Re: Read-only attribute in module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-10 01:04 +0000
Re: Read-only attribute in module Terry Reedy <tjreedy@udel.edu> - 2012-02-09 22:27 -0500
Re: Read-only attribute in module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-10 22:23 +0000
Re: Read-only attribute in module Arnaud Delobelle <arnodel@gmail.com> - 2012-02-10 10:09 +0000
csiph-web