Repository navigation
fix(corekit): give unnamed ListField, PayloadField and SchemaField a default name (#1491) - #1493
Merged
Merged
Conversation
…default name (#1491) ListField.__init__, PayloadField.__init__ and SchemaField.__init__ set no _name, so .name on an unnamed instance -- and on OptionField and its subclasses -- raised AttributeError. Default it with the hasattr idiom FieldBase and Field already use, giving <list>, <option>, <chunklist>, <payload>, <schema>, and so on.
JarryShaw
force-pushed
the
fix/1491-listfield-default-name
branch
from
October 9, 2026 19:45
6a7b110 to
7ea03dd
Compare
2 of 13 tasks
Owner
Author
|
Verdict: GOOD TO GO at
Non-blocking: the leftover |
Contributor
|
Coverage: 89.65% (unit tier, Python 3.14,
Per-file detail: the |
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
ListField.__init__,PayloadField.__init__andSchemaField.__init__set no_name, so.nameon an unnamed instance (and onOptionField/ChunkListField) raisedAttributeError. Each now uses thehasattrdefault fromFieldBase.__init__andField.__init__(field.py:348,field.py:614):<list>,<option>,<chunklist>,<payload>,<schema>. A name set by__set_name__still wins.SwitchFieldandForwardMatchFielddelegate to the wrapped field and are unchanged.New
tests/corekit/test_fields_collections_default_name_1491_unit.py. Fail-before: theListFieldcases failed (4 failed / 2 passed) againstorigin/main'scollections.py, and thePayloadField/SchemaFieldcases failed (2 failed / 4 passed) againstorigin/main'smisc.py. With the fix: 6 passed, 2 subtests passed.Ran (not
make test): that file,tests/corekit(474 passed),tests/project(419 passed, 1 skipped),tests/test_docstring_contract.py(7 passed). Lint not run.Closes #1491