Skip to content

python-xlib: Fixes from Avasam/python-xlib#7 - #16670

Merged
Avasam merged 1 commit into
python:mainfrom
Avasam:python-xlib-list-str-object-default
Nov 1, 2026
Merged

Avasam merged 1 commit into
python:mainfrom
Avasam:python-xlib-list-str-object-default

Conversation

@Avasam

@Avasam Avasam commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Various fixes noticed by Claude Opus 5.5 whilst working on Avasam/python-xlib#7 that apply to types-python-xlib.

  • rq.List accepts rq.Str, a ValueField instance, or any parse-only type with a parse_binary method (like Xlib.ext.xinput.ClassInfo) as its type. rq.FixedList accepts the same types
  • Value fields accept None as their name. rq.Field.name is str | None to match the runtime class default, so the *.name stubtest allowlist entry is no longer needed
  • rq.Object accepts a tuple, dict or DictWrapper as its default, and rq.Object.default has the same type
  • rq.Str.pack_value accepts bytes
  • rq.Struct.fields is a variable-length tuple, not single

- `rq.List` accepts `rq.Str`, a `ValueField` instance, or any parse-only type with a `parse_binary` method (like `Xlib.ext.xinput.ClassInfo`) as its type. `rq.FixedList` accepts the same types.
- Value fields accept `None` as their name. `rq.Field.name` is `str | None` to match the runtime class default, so the `*.name` stubtest allowlist entry is no longer needed.
- `rq.Object` accepts a tuple, dict or `DictWrapper` as its default, and `rq.Object.default` has the same type.
- `rq.Str.pack_value` accepts `bytes`.
- `rq.Struct.fields` is a tuple of any length instead of a single field.
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Avasam
Avasam merged commit 58c33f3 into python:main Nov 1, 2026
74 checks passed
@Avasam
Avasam deleted the python-xlib-list-str-object-default branch November 1, 2026 01:58
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.

2 participants