Conversation
Empty query results and cleared collections should support their documented list operations without requiring a first element. Confidence: high Scope-risk: narrow Tested: 28 platform-agnostic tests; pre-commit all-files; public API QA Not-tested: WebDriver browser matrix
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.
Empty ElementList results currently raise ElementDoesNotExist for ordinary list methods such as append, extend, and count because attribute lookup accesses first before checking the underlying list. Clearing a nonempty list also leaves append unusable.
Allow existing list attributes to resolve directly when the collection is empty. Nonempty first-element forwarding and the existing missing-element exception for actions such as click remain unchanged. Four regression tests cover append, extend, count, and clear followed by append.
Validation: Python 3.12.13,
python -m pytest --ignore-flaky tests/tests_splinter -q: 28 passed.pre-commit run --all-files: all hooks passed. Four new tests failed on the original code. Direct public ElementList API QA also passed, including the preserved missing-element query diagnostic. WebDriver browser matrix was not run because this is a backend-independent collection dispatch change.AI disclosure: This contribution was prepared with OpenAI Codex assistance; the reproduction, patch, and validation were executed locally. Maintainer review is requested.