Re: Custom types and default values
John Belmonte <[email protected]> Mon, 31 May 2004 21:43:04 -0400
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
Greg Ward wrote: >>I'm wondering if you will still be promoting the use of non-string >>defaults for types built into optik. I can image some trouble >>situations, for example you have an int option with a default of 99. >>Then you change the option to a custom type that is an integer with >>range checking, and the range is set to [1, 50]. Since the default is >>not passed through the type checker, the invalid value isn't caught, >>violating an invariant of the program. > > Red herring on two counts: if allowing that scenario is an Optik bug, > it's already a bug in 1.4.1, because you *must* specify > post-type-conversion values there. Right, my scenario was of a future use. > Optik 1.5 will allow you to specify > strings (pre-type-conversion values), but most certainly will not > require it -- that would break everything! My question wasn't if strings would be required, but rather if you would still be promoting the use of non-strings. Anyway, I think I've got the answer :-). > Second, if an application breaks its own invariant, that's not an Optik > bug, it's an application bug. Too bad. I can't argue that it's not an application bug. Having everything come to a halt when you've got some inconsistency in your program is considered a desirable trait by many programmers. -John -- http://giftfile.org/ :: giftfile project ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click