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

What's about type-checking? #898

Closed
last-partizan opened this issue Dec 20, 2021 · 1 comment
Closed

What's about type-checking? #898

last-partizan opened this issue Dec 20, 2021 · 1 comment

Comments

@last-partizan
Copy link
Contributor

The problem

When using factory in the following way:

order = OrderFactory()
order.some_attr

Type-checker (pyright in my case) assumes that order is an instance of the OrderFactory, not Order.

When using OrderFactory.create() or OrderFactory.build(), result will be Unknown and at least type checked would not complain.

Proposed solution

Would be nice to have support for type annotations. Or, at least - define return type for __init__ as Any, so type checker would not incorrectly assume wrong type.

@Kub-AT
Copy link

Kub-AT commented Dec 27, 2021

Check this out: #468 (comment)

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

2 participants