Skip to content

imprv: property and enum stub generation#306

Merged
bryanforbes merged 1 commit into
pygobject:masterfrom
bryanforbes:imprv/props-enums-and-flags
May 12, 2026
Merged

imprv: property and enum stub generation#306
bryanforbes merged 1 commit into
pygobject:masterfrom
bryanforbes:imprv/props-enums-and-flags

Conversation

@bryanforbes
Copy link
Copy Markdown
Collaborator

Generate property stubs with separate getter/setter annotations based on readability, writability, and nullability of the underlying GObject getter/setter. Read-only and write-only props now use @Property and @name.setter respectively, with typing.Never for the unreadable side.

Emit enum/flag value type aliases (_NameLiteralType and _NameValueType) so APIs accepting enum values can also accept their string nicks/names, and consolidate the flag/enum builders into a single helper.

Fixes #259

Generate property stubs with separate getter/setter
annotations based on readability, writability, and
nullability of the underlying GObject getter/setter.
Read-only and write-only props now use @Property and
@name.setter respectively, with typing.Never for the
unreadable side.

Emit enum/flag value type aliases (_NameLiteralType and
_NameValueType) so APIs accepting enum values can also
accept their string nicks/names, and consolidate the
flag/enum builders into a single helper.

Fixes pygobject#259
@bryanforbes bryanforbes merged commit 093ce1a into pygobject:master May 12, 2026
2 checks passed
@bryanforbes bryanforbes deleted the imprv/props-enums-and-flags branch May 12, 2026 13:32
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.

Allow for nicks in place of enums

1 participant