mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 19:38:46 -05:00
[PR #21437] [CLOSED] fix: use 'is None' instead of '== None' in socket handler #41708
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21437
Author: @aviu16
Created: 2/15/2026
Status: ❌ Closed
Base:
main← Head:fix-none-comparison📝 Commits (1)
fea8cf8fix: use 'is None' instead of '== None' in socket handler📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/socket/main.py(+1 -1)📄 Description
Summary
Replace equality comparison with identity check for None value in socket message handler.
Changes
data.get("type") == None→data.get("type") is NoneWhy
According to PEP 8, comparisons to singletons like
Noneshould always be done withisoris not, never the equality operators==or!=.This is because:
is) are faster than equality checks (==)Noneis a singleton, so identity comparison is semantically correct==can lead to unexpected behavior if a class overrides__eq__Test plan
Existing tests should pass. This is a code quality improvement that maintains identical behavior.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.