Skip to content

fix: replace remaining == None with is None, bare except with except Exception#137

Open
Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Jah-yee:fix/python-anti-patterns-remaining
Open

fix: replace remaining == None with is None, bare except with except Exception#137
Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Jah-yee:fix/python-anti-patterns-remaining

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 18, 2026

Good day,

I found and fixed the remaining Python anti-patterns in the codebase that were not addressed in previous PRs.

Changes

1. Replace == None with is None (3 instances)

  • src/biz_layer/mem_memorize.py (lines 1293, 1329, 1348)
  • Following PEP 8: use is None or is not None instead of == None or != None

2. Replace bare except with except Exception (2 instances)

  • src/biz_layer/mem_db_operations.py (line 146)
  • src/infra_layer/adapters/out/search/repository/episodic_memory_milvus_repository.py (line 127)
  • Bare except clauses catch all exceptions including SystemExit and KeyboardInterrupt

Testing

  • Python syntax validation passed (python3 -m py_compile)
  • All modified files compile without errors

Related Issues

感谢你们的奉献,希望能提供帮助。如果我解决得有问题或有待商妥的地方,请在下面留言,我会来处理。

Warmly,
Spark Lab Scout

…Exception

- mem_memorize.py: 3 instances of == None → is None
- mem_db_operations.py: bare except → except Exception
- episodic_memory_milvus_repository.py: bare except → except Exception

Follows Python best practices (PEP 8) for None comparisons and exception handling.
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