~cjwatson/storm/clarify-no-allow-none-default-none-exception

  • Committer: Colin Watson
  • Date: 2022-03-16 16:59:21 UTC
  • Revision ID: cjwatson@canonical.com-20220316165921-8g0y1bnpe3qx0w70
Clarify exception for a property with allow_none=False and default=None.

Creating a property with `allow_none=False, default=None` doesn't make
sense, but it's sometimes easy to set things up that way by accident
during refactoring.  Storm immediately raises `NoneError` when creating
the variable in that case.  However, it's not obvious that the exception
is due to the bad default, and I spent some time with a colleague today
debugging a situation that turned out to be due to this.

Change the exception message from "None isn't acceptable as a value" to
"None isn't acceptable as a default value" in this case, to clue future
travellers into the fact that the problem relates to the default.
Filename Latest Rev Last Changed Committer Comment Size
..
dev 424.2.1 12 years ago David Britton Adding some dev setup scripts. Diff
storm 1 17 years ago Gustavo Niemeyer Adding initial infrastructure. Diff
.bzrignore 566.1.3 3 years ago Colin Watson Restore MySQL support. We've had some requests to 339 bytes Diff Download File
doc-requirements.txt 558 3 years ago Colin Watson Add doc-requirements.txt for readthedocs builds. 7 bytes Diff Download File
LICENSE 129 16 years ago Gustavo Niemeyer Added LGPL version 2.1 in the LICENSE file, and a 25.9 KB Diff Download File
Makefile 487.2.1 4 years ago Colin Watson Add tox testing support. 740 bytes Diff Download File
MANIFEST.in 570 3 years ago Colin Watson Fix MANIFEST.in prune syntax. 206 bytes Diff Download File
NEWS 576 2 years ago Colin Watson Clarify exception for a property with allow_none=F 28.1 KB Diff Download File
README 566.1.3 3 years ago Colin Watson Restore MySQL support. We've had some requests to 5.6 KB Diff Download File
setup.cfg 413 12 years ago Barry Warsaw Add .tar.gz format. 32 bytes Diff Download File
File setup.py 568.1.1 3 years ago Colin Watson Support Python 3.9. 2.8 KB Diff Download File
TODO 274 15 years ago Gustavo Niemeyer Updated TODO file with Gavin Panella's suggestion 2.4 KB Diff Download File
tox.ini 568.1.1 3 years ago Colin Watson Support Python 3.9. 710 bytes Diff Download File