Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support instantiating objects by calling the factory class #60

Open
seddonym opened this issue Nov 2, 2023 · 0 comments
Open

Support instantiating objects by calling the factory class #60

seddonym opened this issue Nov 2, 2023 · 0 comments

Comments

@seddonym
Copy link

seddonym commented Nov 2, 2023

Currently, if I use the factory class directly to create an object, it's type hinted as the factory class:

user = UserFactory()
reveal_type(user)  # UserFactory
type(user) # User

I think this might be because the return value of BaseFactory.__new__ is annotated with Self rather than T?

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

No branches or pull requests

1 participant