Skip to content

Conversation

@richardm-stripe
Copy link
Contributor

@richardm-stripe richardm-stripe commented Oct 18, 2023

In this one, the goal is to fully type StripeObject. I add # pyright: strict to the top, and also make sure every method has a return annotation. Now, pyright --verifytypes no longer complains about Type of base class "stripe.stripe_object.StripeObject" is partially unknown for the (many) classes that inherit from StripeObject.

The really hard thing, that I haven't been ready to tackle yet, is coming up with good types for stripe.http_client, so there are some pretty unsatisfying Any and casts in this one, but I'm hoping that adding types around the periphery will make it easier to tackle eventually.

Pyright reports

Type completeness score: 96.1%

after this (up from 94.3%)

@richardm-stripe richardm-stripe changed the title More type annotations Even more type annotations Oct 18, 2023
@richardm-stripe richardm-stripe changed the base branch from richardm-more-types-2 to master October 18, 2023 19:32
@richardm-stripe richardm-stripe enabled auto-merge (squash) October 18, 2023 21:57
@richardm-stripe richardm-stripe merged commit e8cb141 into master Oct 18, 2023
@richardm-stripe richardm-stripe deleted the richardm-more-types-3 branch October 18, 2023 22:13
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.

3 participants