youtux / types-factory-boy

Type stubs for factory-boy
MIT License
17 stars 4 forks source link

Support instantiating objects by calling the factory class #60

Open seddonym opened 10 months ago

seddonym commented 10 months ago

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?