Skip to content

Conversation

@maliubiao
Copy link

if _initialized:
    raise ValueError("Calling init() twice will result in recursion.")
if not _initialized:
    _initialized = True
  • Logic: Ensures init() is called only once. Re-initialization would cause recursion (wrapped streams re-wrap themselves).

   ```python
   if _initialized:
       raise ValueError("Calling init() twice will result in recursion.")
   if not _initialized:
       _initialized = True
   ```
   - **Logic**: Ensures `init()` is called only once. Re-initialization would cause recursion (wrapped streams re-wrap themselves).
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