lp://staging/~cjwatson/storm/clarify-no-allow-none-default-none-exception
Created by
Colin Watson
and last modified
- Get this branch:
- bzr branch lp://staging/~cjwatson/storm/clarify-no-allow-none-default-none-exception
Only
Colin Watson
can upload to this branch. If you are
Colin Watson
please log in for upload directions.
Branch merges
Propose for merging
No branches
dependent on this one.
- Ioana Lasc (community): Approve
-
Diff: 168 lines (+64/-16)6 files modifiedNEWS (+6/-0)
storm/cextensions.c (+9/-0)
storm/tests/mocker.py (+4/-0)
storm/tests/properties.py (+8/-0)
storm/tests/variables.py (+30/-13)
storm/variables.py (+7/-3)
Branch information
Recent revisions
- 576. By Colin Watson
-
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.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp://staging/storm