Thread: Re: [Rest2web-develop] None and Defaults
Brought to you by:
mjfoord
From: Michael F. <mi...@pc...> - 2005-08-16 18:30:55
|
Ok. What about attribute access - we leaving it in ? Lots of Section attributes clash with possible key names - 'defaults', 'sections', 'scalars', etc Fuzz -----Original Message----- >From: "Nicola Larosa"<ni...@te...> >Sent: 16/08/05 17:09:41 >To: "res...@li..."<res...@li...> >Subject: Re: [Rest2web-develop] None and Defaults > >>> I'm cool with the "None" string, by itself, always meaning the None value, >>> like True or False, but not restricted to one check type. Maybe we should >>> take out that "lower" method, though. > >> I'm not - ConfigObj shouldn't change the type without the programmer >> specifying it. > >Good point. > > >> Don't forget the value is set by the *user* - not the programmer. >> ConfigObj should only convert type if the programmer says. None >> shouldn't be an acceptable value for every check - maybe it *isn't* an >> acceptable value (what if the programmer really does want an integer >> there - he expects validate to tell him). > >Yes, actually None is a value of type NoneType. Hadn't realized that >before, was thinking of it as an amorphous no-type-every-type non-value. > > >> This means that someone's program will break because a user enters >> 'None' as a string value. It ought to be possible to have 'None' as a >> string value in a config file without our program converting it to >> another type. > >Another good point. > > >> I thought the point was to catch defaults ? > >Yes, it was, but then I incautiously adventured into YAGNI land. ;-) > > >> My proposed (and currently committed) solution allows the programmer to >> specify that None is ok (by using default='None'), which makes the value >> explicitly (user sets value as 'None') > >I don't think the user may explicitly set a None value, now, but it may as >well be that way. > > >> and implicitly (user omits value altogether) optional. > >That's probably enough. > > >> I'm fine with removing the 'lower'. > >So be it. Sorry for the confusion. > >-- >Nicola Larosa - ni...@te... > >Python is the best thing I've seen in 30 years of computing for >pedogogical and productive purposes. Only when I want speed do I >see a need for something else. -- Chuck Allison, June 2005 > > > >------------------------------------------------------- >SF.Net email is Sponsored by the Better Software Conference & EXPO >September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices >Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA >Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf >_______________________________________________ >Rest2web-develop mailing list >Res...@li... >https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |
From: Michael F. <mi...@pc...> - 2005-08-16 19:48:26
|
Hello Nicola, -----Original Message----- >From: "Nicola Larosa"<ni...@te...> >Sent: 16/08/05 20:05:46 >To: "res...@li..."<res...@li...> >Subject: Re: [Rest2web-develop] None and Defaults >> What about attribute access - we leaving it in ? > >I'd like to keep it, yes, but... > > >> Lots of Section attributes clash with possible key names - 'defaults', >> 'sections', 'scalars', etc > >...this is unacceptable. At the very least they could be renamed with >double underscore before and after, or even better they should be separated >in an appropriate namespace somehow. That's also true of ConfigObj parameters. > This is exactly why attribute access is bad. The object namespace is the RIGHT place. These *are* public attributes of the section. Are you going to move section methods to another namespace as well ? (a rhetorical question). All the private attributes/methods already start with a single underscore. >Let's decide on an approach and I'll do the dirty work, promised. :-) > I'm -1 on moving/removing Section/ConfigObj attributes. I don't *mind* leaving attribute access in - but I don't like it especially. Best Regards, Fuzzyman http://www.voidspace.org.uk/python >-- >Nicola Larosa - ni...@te... > >Python is the best thing I've seen in 30 years of computing for >pedogogical and productive purposes. Only when I want speed do I >see a need for something else. -- Chuck Allison, June 2005 > > > >------------------------------------------------------- >SF.Net email is Sponsored by the Better Software Conference & EXPO > > > [Message truncated. Tap Edit->Mark for Download to get remaining portion.] |
From: Nicola L. <ni...@te...> - 2005-08-16 20:35:45
|
> This is exactly why attribute access is bad. > > The object namespace is the RIGHT place. These *are* public attributes of > the section. Are you going to move section methods to another namespace > as well ? (a rhetorical question). Very good point. > I'm -1 on moving/removing Section/ConfigObj attributes. > > I don't *mind* leaving attribute access in - but I don't like it > especially. No, not in this shape. Too messy, too much guesswork. Did it work whis way in v.3 too? Ok, take it away, I'll cope. -- Nicola Larosa - ni...@te... Python is the best thing I've seen in 30 years of computing for pedogogical and productive purposes. Only when I want speed do I see a need for something else. -- Chuck Allison, June 2005 |
From: Michael F. <mi...@pc...> - 2005-08-16 21:50:33
|
Hello Nicola, -----Original Message----- >From: "Nicola Larosa"<ni...@te...> >Sent: 16/08/05 21:35:34 ... > >> I'm -1 on moving/removing Section/ConfigObj attributes. >> >> I don't *mind* leaving attribute access in - but I don't like it >> especially. > >No, not in this shape. Too messy, too much guesswork. Did it work whis way >in v.3 too? > Yes it was for convenience, mainly just because it's how other packages do it. They get round the problem (I think) by using functions rather than methods or providing getters and setters. Neither are particularly pythonic. Fuzzball >Ok, take it away, I'll cope. > >-- >Nicola Larosa - ni...@te... > >Python is the best thing I've seen in 30 years of computing for >pedogogical and productive purposes. Only when I want speed do I >see a need for something else. -- Chuck Allison, June 2005 > > [Message truncated. Tap Edit->Mark for Download to get remaining portion.] |
From: Nicola L. <ni...@te...> - 2005-08-16 19:05:55
|
> What about attribute access - we leaving it in ? I'd like to keep it, yes, but... > Lots of Section attributes clash with possible key names - 'defaults', > 'sections', 'scalars', etc ...this is unacceptable. At the very least they could be renamed with double underscore before and after, or even better they should be separated in an appropriate namespace somehow. That's also true of ConfigObj parameters. Let's decide on an approach and I'll do the dirty work, promised. :-) -- Nicola Larosa - ni...@te... Python is the best thing I've seen in 30 years of computing for pedogogical and productive purposes. Only when I want speed do I see a need for something else. -- Chuck Allison, June 2005 |