Skip to content

Register the object-level field-access operations of both languages - #42

Merged
samuelduchesne merged 1 commit into
mainfrom
015-object-multi-field-update
Oct 21, 2026
Merged

samuelduchesne merged 1 commit into
mainfrom
015-object-multi-field-update

Conversation

@samuelduchesne

Copy link
Copy Markdown
Contributor

Summary

Adds three entries to governance/naming.toml, beside the other object-level entries.

Concept Python TypeScript Kind
read a field by name IDFObject.get IdfObject.get aligned
write one field by name item assignment ("") IdfObject.set divergent: operator idiom
apply several fields to an object IDFObject.update IdfObject.update divergent: return value only

Context

These four public members (IdfObject.get, set, update; IDFObject.get) are unregistered today. Neither naming gate notices, because the gates check only exports and, in Python, IDFDocument members.

The third entry is registered ahead of the Python implementation, as the register's header requires. It anticipates IDFObject.update, requested in idfkit/idfkit#235. It also records the proposed shared contract: every entry is examined before any is applied; unknown names, name, legacy flat extensible names, and a non-list value for the wrapper key are refused; and every refused entry is reported. The notes distinguish it from the excluded eppy IDFDocument.update, which takes dot-path keys.

Review requested from the TypeScript side

Two points need explicit acceptance from a TypeScript maintainer:

  1. The contract implies a behaviour change to IdfObject.update. Today it applies entries up to the first unknown name and then throws. Under the contract, it would examine every entry before writing any, and throw listing every refused entry. The signature and the this return are unchanged.
  2. The follow-up conformance work adds an update operation kind and a post-operation-epjson assertion. The expected output is generated by ConvertInputFormat from a committed after.idf. That work comes in a separate pull request, but agreement on the contract is requested here first.

Checks

  • python tools/validate_governance.py: passed (278 entries).
  • python -m pytest tests -q: 322 passed.
  • idfkit/scripts/check_naming_register.py --register and idfkit-js/scripts/check-naming-register.mjs --register --build against this file: both pass, with results unchanged from the pinned run.

After merge, this is released as governance-2026.30.

Three entries in governance/naming.toml, beside the other object-level
entries:

- "read a field by name": IDFObject.get and IdfObject.get, aligned.
- "write one field by name": item assignment in Python and IdfObject.set
  in TypeScript, divergent under the operator-overloading rule.
- "apply several fields to an object": IDFObject.update and
  IdfObject.update, divergent in the return value only. Registered ahead
  of the Python implementation, and distinguished from the excluded eppy
  dot-path IDFDocument.update.

None of the three changes the result of either naming gate, which check
exports and, in Python, IDFDocument members only. Both gates pass
against this file with --register.

idfkit-unification feature 015, FR-013.
@samuelduchesne
samuelduchesne requested review from a team as code owners October 21, 2026 12:11
@samuelduchesne
samuelduchesne merged commit 55a7ca5 into main Oct 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant