Skip to content

Conversation

DaleStack
Copy link

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

  1. headers field uses DEFAULT_HEADERS.copy directly, which evaluates at module load time. This can lead to shared state across instances.
  2. The replace() method instantiates ClientOptions() directly, breaking subclass behavior for AsyncClientOptions and SyncClientOptions.

What is the new behavior?

  • The headers field now uses a lambda to ensure a fresh copy of DEFAULT_HEADERS per instance.
  • The replace() method now uses type(self)() to preserve subclass overrides.

Additional context

This PR only addresses the bugs listed above.

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.

1 participant