Skip to content

Use decorator form for factory.register() - #1498

Merged
dxqb merged 1 commit into
Nerogar:mergefrom
dxqb:factory-register-decorator
Jun 15, 2026
Merged

dxqb merged 1 commit into
Nerogar:mergefrom
dxqb:factory-register-decorator

Conversation

@dxqb

@dxqb dxqb commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

pythonic form of the factory pattern introduced by #1211

factory.register() now detects whether its second argument is a type
(direct call form for loops) or an enum key (decorator form), allowing
implementations to declare themselves with @factory.register() directly
on the class definition instead of imperative calls at the bottom of
the file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dxqb dxqb added the preview merged in the preview branch label Jun 4, 2026
dxqb added a commit that referenced this pull request Jun 14, 2026
@dxqb
dxqb changed the base branch from master to merge June 15, 2026 22:09
@dxqb
dxqb merged commit 75a44d2 into Nerogar:merge Jun 15, 2026
1 check passed
@dxqb
dxqb deleted the factory-register-decorator branch June 15, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview merged in the preview branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant