Zahari Dim <> added the comment:

> ISTM that this is the wrong stage to perform validation of allowable values.  
> That should occur upstream when the underlying mappings are first created.  
> At that earlier stage it possible to give a more timely response to erroneous 
> input and there is access to more information (such as the line and row 
> number of an error in a configuration file).
> It doesn't make sense to me to defer value validation downstream after a 
> ChainMap instance has been formed and after a successful lookup has occurred. 
> That just complicates the task of tracing back to the root cause.

This is certainly the case in the situation where the validation only
depends on the value of the corresponding configuration entry, as it
admittedly does in the example above. However the example was
oversimplified insofar non trivial validation depends on the whole
ensemble configuration settings. For example taking the example
described at the top of
I think it would be useful to have an error message of the form:
f"User '{db_username}', defined in {configsetttings[user_index]} is
not found in database '{database}', defined in

> > Maybe the method could be called
> That would be better than get_where().
> ----------
> _______________________________________
> Python tracker <>
> <>
> _______________________________________


Python tracker <>
Python-bugs-list mailing list

Reply via email to