docs: clarify is_initialized() semantics (SDK-2641)#454
Merged
Conversation
The is_initialized() docstring claimed the method returns true only after successfully connecting to LaunchDarkly. In reality it also returns true in offline mode, in LDD/daemon mode, and whenever a persistent store already has (possibly stale) cached data -- none of which require a live connection. Reword to align with the Go SDK's Initialized() documentation: describe it as 'initialized and has flag data available', note that offline/LDD always return true, warn that a true result does not guarantee flag data is up to date, and point to data_source_status_provider for connection status. Docstring only; no behavior change.
jsonbailey
reviewed
Jul 7, 2026
jsonbailey
reviewed
Jul 7, 2026
| If this returns false, it means the client has not yet obtained any flag data. It might still be | ||
| starting up, or attempting to reconnect after an unsuccessful attempt, or it might have received | ||
| an unrecoverable error (such as an invalid SDK key) and given up. In this state, feature flag | ||
| evaluations will return default values -- unless you are using a persistent store integration and |
Contributor
There was a problem hiding this comment.
This part about persistent stores conflicts or at least can be a little confusing here since it is mentioned in the paragraph when it returns true.
Per review: the standalone 'Additionally, offline/LDD always returns true' paragraph duplicated the offline/LDD case already listed in the first paragraph. Removed it. (The Go SDK keeps that callout only because its first paragraph does not mention offline.)
jsonbailey
approved these changes
Jul 7, 2026
jsonbailey
left a comment
Contributor
There was a problem hiding this comment.
Minor comments but I don't think they need to block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Rewrites the
LDClient.is_initialized()docstring in the Python server SDK. Docstring only — no behavior change.Why
The old docstring claimed the method "Returns true if the client has successfully connected to LaunchDarkly." That overpromises. The implementation returns
Truein three cases, only one of which involves a live connection:Trueunconditionally, no connection attempted.use_ldd) — returnsTruepurely from the config flag.data_availability.at_least(CACHED)— a populated (possibly stale) persistent store satisfies this even if the live data source never connected, is still retrying, or permanently failed. Per the enum,CACHEDmeans "data, not necessarily the latest."The Go, Ruby, and JS SDKs all word their equivalent around "initialized/ready" with explicit hedges. Go is the clearest, so this change aligns the Python wording with Go's
Initialized():True.Trueresult does not guarantee flag data is up to date.data_source_status_providerfor connection-status detail.Ticket
SDK-2641
Note
Low Risk
Docstring-only update with no logic, API, or runtime changes.
Overview
Documentation-only change to
LDClient.is_initialized()inldclient/client.py— runtime behavior is unchanged.The docstring no longer claims the client has successfully connected to LaunchDarkly. It now describes initialized with flag data available (live data, persistent cache, or offline/LDD), notes that
Truedoes not mean data is current, and directs integrators todata_source_status_providerfor connection detail. It also spells out whenFalseapplies and how evaluations behave (defaults vs. prior persistent-store data).Reviewed by Cursor Bugbot for commit a30032e. Bugbot is set up for automated code reviews on this repo. Configure here.