textual icon indicating copy to clipboard operation
textual copied to clipboard

Fix Number and Float validation errors, allow underscores, add tests. Fix issue #4718

Open merriam opened this issue 7 months ago • 1 comments

Please review the following checklist.

  • [ n/a] Docstrings on all new or modified functions / classes
  • [ tbd] Updated documentation
  • [ tbd] Updated CHANGELOG.md (where appropriate)

Here are some changes to the Validation routines:

  • Number validator no longer accepts 'nan'.
  • Number regex no longer accepts 'e' as first character of a number.
  • Integers no longer accept scientific notation. That is, "1.23e2" happens to resolve to an integer if first viewed as a float, but cannot be cast with int(value).
  • Integers and floats allow underscores, per the Python standard. That is, "1_000_000" is a valid integer and can be typed in a "integer" type field. "12." cannot be typed or validated.

The tbd on documentation: does this warrant a note in the CHANGELOG.md? Also, I started cleaning up the Input Widet documentation and its worth a different commit.

merriam avatar Jul 22 '24 03:07 merriam