Re: 1st Sketch at at ReadOnly dict

2014-01-20 Thread Charles Hixson
On 01/20/2014 08:14 PM, Dan Stromberg wrote: On Mon, Jan 20, 2014 at 12:09 PM, Charles Hixson wrote: class RODict: #Instance Variable Doc ##@var_ddict #This variable holds the reference to the dict. ##Class initializer. #@paramddictThe

Re: 1st Sketch at at ReadOnly dict

2014-01-20 Thread Dan Stromberg
On Mon, Jan 20, 2014 at 12:09 PM, Charles Hixson wrote: > class RODict: > #Instance Variable Doc > ##@var_ddict > #This variable holds the reference to the dict. > > ##Class initializer. > #@paramddictThe data dictionary to which this is a read

Re: 1st Sketch at at ReadOnly dict

2014-01-20 Thread Charles Hixson
On 01/20/2014 04:08 PM, Chris Angelico wrote: On Tue, Jan 21, 2014 at 7:09 AM, Charles Hixson wrote: #@note Instances can be created only from existing dicts. ##Class initializer. #@paramddictThe data dictionary to which this is a read only #acces

Re: 1st Sketch at at ReadOnly dict

2014-01-20 Thread Chris Angelico
On Tue, Jan 21, 2014 at 7:09 AM, Charles Hixson wrote: > #@note Instances can be created only from existing dicts. > > ##Class initializer. > #@paramddictThe data dictionary to which this is a read only > #access. > #@throwsTypeError if ddict

Re: 1st Sketch at at ReadOnly dict

2014-01-20 Thread Charles Hixson
On 01/20/2014 12:52 PM, Peter Otten wrote: Charles Hixson wrote: This is just a first sketch, and I haven't yet attempted to test it, so what I'm hoping for is criticisms on the general approach. class RODict: def __init__ (self, ddict = {}): Default values are evaluted just once when t

Re: 1st Sketch at at ReadOnly dict

2014-01-20 Thread Peter Otten
Peter Otten wrote: > Charles Hixson wrote: > >> This is just a first sketch, and I haven't yet attempted to test it, so >> what I'm hoping for is criticisms on the general approach. >> >> class RODict: > >> def __init__ (self, ddict = {}): > > Default values are evaluted just once when th

Re: 1st Sketch at at ReadOnly dict

2014-01-20 Thread Peter Otten
Charles Hixson wrote: > This is just a first sketch, and I haven't yet attempted to test it, so > what I'm hoping for is criticisms on the general approach. > > class RODict: > def __init__ (self, ddict = {}): Default values are evaluted just once when the method is created. Mutable defau

1st Sketch at at ReadOnly dict

2014-01-20 Thread Charles Hixson
This is just a first sketch, and I haven't yet attempted to test it, so what I'm hoping for is criticisms on the general approach. ##Read Only dict class. #@note Instances can be created only from existing dicts. #@warningvalues within the RODict can be accessed, so if they hold