Skip to content

Make shallow copies of lists instead of deep copies #1490

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

Merged
merged 1 commit into from
Aug 15, 2025
Merged

Conversation

rm-openai
Copy link
Collaborator

@rm-openai rm-openai commented Aug 15, 2025

We were making deep copies, which is (1) inefficient and (2) causes some pickling errors.

Instead, this PR just makes shallow copies, calling list.copy(). We do want a shallow copy so that mutations don't affect the original past-end list.

@seratch seratch added bug Something isn't working feature:core labels Aug 15, 2025
@rm-openai rm-openai merged commit 07345d0 into main Aug 15, 2025
12 checks passed
@rm-openai rm-openai deleted the rm/pr1490 branch August 15, 2025 15:22
vcshih pushed a commit to veris-ai/openai-agents-python that referenced this pull request Aug 15, 2025
We were making deep copies, which is (1) inefficient and (2) causes some
pickling errors.

Instead, this PR just makes shallow copies, calling list.copy(). We do
want a shallow copy so that mutations don't affect the original past-end
list.
@rm-openai rm-openai mentioned this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants