-
Notifications
You must be signed in to change notification settings - Fork 438
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
Move resource type exports to stripe.___ #1142
Move resource type exports to stripe.___ #1142
Conversation
222c0a2
to
6d0c5a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the best I could spot-checking this and left some small questions. The approach in general looks good, and the import tests and the fact that the existing test suite passes gives me a lot of confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the nits and bringing back recipient_transfer.py
, this looks great to me! Love the deprecation warnings / tests / linter rules. And thanks for breaking it up into easy-to-review commits ❤️
cf8c295
to
f1f0ab0
Compare
f1f0ab0
to
59f7176
Compare
def __getattr__(name): | ||
if name == "abstract": | ||
import stripe.api_resources.abstract as _abstract | ||
|
||
return _abstract | ||
if name == "api_resources": | ||
import stripe.api_resources as _api_resources | ||
|
||
return _api_resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to raise AttributeError
rather than falling off the end and returning None
.
Docs should probably be updated: https://docs.stripe.com/error-handling?lang=python Currently uses |
Thanks for reporting that @silviogutierrez |
Deprecated modules are highlighted in pycharm and cause type errors in MyPy and Pyright, the warning is logged when importing deprecated module.
Changelog
stripe.error
,stripe.stripe_object
,stripe.api_requestor
,stripe.stripe_response
,stripe.request_options
,stripe.api_resources.*
,stripe.api_resources.abstract.*
modules are deprecated. All types are available directly fromstripe
module now.Before: