Skip to content

refactor: remove redundant InitInputType class attribute#10

Merged
rustyconover merged 1 commit into
mainfrom
remove-redundant-initinputtype
Jan 5, 2026
Merged

refactor: remove redundant InitInputType class attribute#10
rustyconover merged 1 commit into
mainfrom
remove-redundant-initinputtype

Conversation

@rustyconover

Copy link
Copy Markdown
Contributor

Summary

  • Add _get_init_input_type() classmethod to Function that infers the init input type from the generic parameter Function[T] using __orig_bases__ and get_args()
  • Remove explicit InitInputType class attributes from ScalarFunctionGenerator and TableFunctionBase
  • Result is cached per class for efficiency

This eliminates the duplication where the type is specified both in the generic parameter and as a class attribute.

Test plan

  • All existing tests pass (529 tests)
  • Mypy type checking passes
  • Ruff linting passes

🤖 Generated with Claude Code

Add _get_init_input_type() classmethod that infers the init input type
from the generic parameter Function[T] using __orig_bases__ and
get_args(). This eliminates the need for explicit InitInputType class
attributes in subclasses.

- Add _get_init_input_type() with per-class caching
- Remove InitInputType from ScalarFunctionGenerator
- Remove InitInputType from TableFunctionBase

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rustyconover rustyconover merged commit 319ccc6 into main Jan 5, 2026
0 of 16 checks passed
@rustyconover rustyconover deleted the remove-redundant-initinputtype branch January 5, 2026 03:04
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.

1 participant