[Zope3-checkins] CVS: Zope3/src/zope/schema -_bootstrapfields.py:1.21

Garrett Smith garrett at mojave-corp.com
Thu Aug 14 09:16:20 EDT 2003


Fred L. Drake, Jr. wrote:
> -_bootstrapfields.py:1.21
> 
> 
> 
> Garrett Smith writes:
>  > +    # If a field has no assigned value, it will be set to
>  missing_value. >      missing_value = None
>  > +    _missing_value_marker = object()
> ...
>  > -                 ):
>  > +                 missing_value=_missing_value_marker):
> ...
>  > +        if missing_value is not self._missing_value_marker:
>  > +            self.missing_value = missing_value
> 
> Maybe I'm missing something fundamental, but... why not just just set
> the default missing_value=None, and simply set it on the instance
> unconditionally?
> 
> 
>   -Fred

Fields define missing_value as class attributes and I don't want to
overwrite those values unless missing_value is specified in the
initializer. I'm not using None because that's a valid missing value.

 -- Garrett



More information about the Zope3-Checkins mailing list