Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Looking at the braintree source, the braintree.Environment class has references to preset Environment instances:
braintree.Environment
>>> import braintree >>> dir(braintree.Environment) ['All', 'Development', 'Production', 'QA', 'Sandbox', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'auth_url', 'base_url', 'braintree_root', 'graphql_port', 'graphql_server', 'graphql_server_and_port', 'parse_environment', 'port', 'protocol', 'server', 'server_and_port']
Notice the All, Development, Production, QA, Sandbox attributes above.
It seems braintree type stubs don't know about these. In my client code I configure the braintree library like so:
braintree.Configuration.configure( **{ "environment": braintree.Environment.Sandbox, "merchant_id": "...", "public_key": "...", "private_key": "...", } )
This code triggers a mypy warning:
path/to/file.py:123: error: "type[Environment]" has no attribute "Sandbox" [attr-defined]
The text was updated successfully, but these errors were encountered:
Improve stubs for braintree.environment
braintree.environment
d7dba59
Fixes #10905
Awesome, thank you for the quick fix!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Looking at the braintree source, the
braintree.Environment
class has references to preset Environment instances:Notice the All, Development, Production, QA, Sandbox attributes above.
It seems braintree type stubs don't know about these. In my client code I configure the braintree library like so:
This code triggers a mypy warning:
The text was updated successfully, but these errors were encountered: