Enhancement: Add proper typings to create_factory
function
#358
Labels
enhancement
New feature or request
create_factory
function
#358
Summary
When using the imperative code style to create factories, the returned factory is not properly type. Objects built with those factories are typed as
Any
.Instead, I would the returned factory to be typed accordingly to the actual model passed allowing type checkers and code editors to take advantage of it.
Basic Example
If you check the type of fac here, you'll get:
type[BaseFactory[Any]]
.I would have instead
type[ModelFactory[Foo]]
Drawbacks and Impact
No response
Unresolved questions
I actually tried to do it myself but could not find a suitable solution
Funding
The text was updated successfully, but these errors were encountered: