@@ -203,7 +203,40 @@ You can disable this behavior if you prefer:
203203stripe.enable_telemetry = False
204204```
205205
206- ### Beta SDKs
206+ ## Types
207+
208+ In [v7.1.0](https://github.com/stripe/stripe-python/releases/tag/v7.1.0) and
209+ newer, the
210+ library includes type annotations. See [the wiki](https://github.com/stripe/stripe-python/wiki/Inline-type-annotations)
211+ for a detailed guide.
212+
213+ Please note that some annotations use features that were only fairly recently accepted,
214+ such as [`Unpack[TypedDict]`](https://peps.python.org/pep-0692/#specification) that was
215+ [accepted](https://discuss.python.org/t/pep-692-using-typeddict-for-more-precise-kwargs-typing/17314/81)
216+ in January 2023. We have tested that these types are recognized properly by [Pyright](https://github.com/microsoft/pyright).
217+ Support for `Unpack` in MyPy is still experimental, but appears to degrade gracefully.
218+ Please [report an issue](https://github.com/stripe/stripe-python/issues/new/choose) if there
219+ is anything we can do to improve the types for your type checker of choice.
220+
221+ ### Types and the Versioning Policy
222+
223+ We release type changes in minor releases. While stripe-python follows semantic
224+ versioning, our semantic versions describe the *runtime behavior* of the
225+ library alone. Our *type annotations are not reflected in the semantic
226+ version*. That is, upgrading to a new minor version of stripe-python might
227+ result in your type checker producing a type error that it didn' t before. You
228+ can use a ` ~=x.x` or ` x.x.* ` [version specifier](https://peps.python.org/pep-0440/# examples)
229+ in your ` requirements.txt` to constrain ` pip` to a certain minor range of ` stripe-python` .
230+
231+ # ## Types and API Versions
232+
233+ The types describe the [Stripe API version](https://stripe.com/docs/api/versioning)
234+ that was the latest at the time of release. This is the version that your library
235+ sends by default. If you are overriding ` stripe.api_version` , or using a
236+ [webhook endpoint](https://stripe.com/docs/webhooks#api-versions) tied to an older version,
237+ be aware that the data you see at runtime may not match the types.
238+
239+ # # Beta SDKs
207240
208241Stripe has features in the beta phase that can be accessed via the beta version of this package.
209242We would love for you to try these and share feedback with us before these features reach the stable phase.
0 commit comments