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

Fix mutable default argument in APIRequest class #447

Merged
merged 1 commit into from
May 23, 2023

Conversation

isabelaconstantin
Copy link
Contributor

This change prevents result to be shared among all instances of APIRequest (see this common gotcha)
Otherwise, with the current initialisation, the result instance variable will gradually accumulate all errors encountered so far in the previous API Requests.

@ted-at-openai
Copy link
Collaborator

Whoops, that was bad. Thanks for the catch, as well as the fix!

@ted-at-openai ted-at-openai merged commit ebf75b2 into openai:main May 23, 2023
@isabelaconstantin
Copy link
Contributor Author

Thanks!

katia-openai pushed a commit that referenced this pull request Feb 29, 2024
Fix mutable default argument in APIRequest class
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.

None yet

2 participants