Re: Read-only attribute in module

2012-02-13 Thread mloskot
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 >&g

Re: Read-only attribute in module

2012-02-10 Thread mloskot
Terry Reedy wrote > > On 2/9/2012 6:43 AM, Mateusz Loskot wrote: >> import xyz print(xyz.flag) # OK >> xyz.flag = 0 # error due to no write access > > Why prevent that? If you called it 'FLAG', that would indicate that it > is a constant that should not be changed. While Python make some effor

Re: Read-only attribute in module

2012-02-09 Thread mloskot
Ben Finney-10 wrote > > Mateusz Loskot writes: > >> So, the following >> >> import xyz >> print(xyz.flag) # OK >> xyz.flag = 0# error due to no write access > > PEP 8 ; gives the style > guide for Python code (strictly for the standa

Re: How do I tell "incomplete input" from "invalid input"?

2012-01-11 Thread mloskot
Terry Reedy wrote > > On 1/11/2012 8:50 AM, Mateusz Loskot wrote: >> Unfortunately, this FAQ is either old or incomplete thus incorrect. > > If you have a suggested change to the current text, please submit it to > the tracker at bugs.python.org > Yes, this is quite obvious procedure to me, b