Join GitHub today
Add traitlet for validating number format #1550
Prior to this PR, the
This PR adds a trait that validates that the format string is correctly formatted. The code for this PR is very much inspired by the format specifier parsing code in d3-format.
>>> import ipywidgets as widgets >>> widgets.FloatSlider(readout_format='..3f') # [...] stack trace TraitError: The 'readout_format' trait of a FloatSlider instance must be a valid number format, but a value of u'..3f' <type 'unicode'> was specified.