feat: export NotSet sentinel and is_not_set() helper - #91
Conversation
Additive only: `i2.NotSet` (the existing `i2.deco.NotSet`) and a new `i2.is_not_set(x)` predicate are exported so signature consumers (front, py2http, ...) can recognise the sentinel as "required / no default" before FuncFactory ever puts it in a signature. No existing behaviour changes. Refs #48 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Dependents run against this branch (py3.12,
Also green on their own default test config: Independent refute-review (sub-agent): no breakage found. Checked |
What
Step 1 of the re-land plan in #48 (additive only):
i2.NotSet: the existingi2.deco.NotSetsentinel, now exported from the package root (same object; it pickles back to itself, so identity checks stay valid).i2.is_not_set(x): returnsx is NotSet. Signature consumers use it asis_not_set(param.default)to treat aNotSetdefault likeinspect.Parameter.empty("required, no default").No existing behaviour changes.
FuncFactory's signature is untouched: #88 is not re-applied, and the #89 guard testtest_func_factory_signature_keeps_required_params_requiredstill passes.Refs #48 (not closing: steps 2 and 3 remain, see the issue).
Why
frontandpy2httpneed to recognise the sentinel before #88 can be re-applied. Their follow-up PRs will importis_not_setfromi2, with a fallback for olderi2.Gate
pytest --doctest-modules i2(py3.12): 764 passed, 2 xfailed (master: 762 passed, 2 xfailed; +2 = new test and new doctest)black --check -Son the changed files: cleani2or definesis_not_set, so the new root names cannot shadow anything. Test suites offront,py2http,meshed,streamlitfront,dagapp,opyratorfront,ju,slang,config2py,know,extruderun against this branch: see the comment below.🤖 Generated with Claude Code