ConfigValue#
- class ConfigValue(input, key, origin=None)#
Bases:
objectValue obtained from a source.
It stores a number of information about the value (its origin, initial value, etc.).
- Parameters:
- get_value()#
Return the actual value to use as parameter.
By default, use the
valueattribute, unless it isUndefinedthen use the initial value (possibly unparsed).- Return type:
- input#
The initial value obtained.
- key#
The key this value was associated to.
- origin#
A description of the configuration source it was found in.
- parse()#
Parse the initial value.
Parsing traits is done by either
TraitType.from_stringorContainer.from_string_listfor container traits.We have to choose the correct function, and
traitlets.Uniontraits does not do that (if no correct parsing is found it just return the input string, and if a correct value is extracted the trait tries to validate it and may fail and raise).This method tries to handle containers and union more gracefully. If all options have been tried and no parsing was successful the function will raise.
- Return type:
None