Home | Trees | Indices | Help |
---|
|
object --+ | ReadOnly
A ReadOnly object wraps another object and prevents all the contained object's fields from being written. Example use:
from grizzled.misc import ReadOnly from grizzled.config import Configuration config = Configuration() config.read('/path/to/some/file') roConfig = ReadOnly(config)
Any attempt to set fields within roConfig will cause a ReadOnlyObjectError to be raised.
The __class__ member of the instantiate ReadOnly class will be the class of the contained object, rather than ReadOnly (Configuration in the example). Similarly, the isinstance() built-in function will compare against the contained object's class. However, the type() built-in will return the ReadOnly class object.
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
|
x.__getattribute__('name') <==> x.name
|
x.__setattr__('name', value) <==> x.name = value
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Mar 14 15:21:06 2016 | http://epydoc.sourceforge.net |