Skip to content

fix: resolve Python anti-patterns and remove duplicate rrf entry#154

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

fix: resolve Python anti-patterns and remove duplicate rrf entry#154
Jah-yee wants to merge 1 commit intoEverMind-AI:mainfrom
Jah-yee:fix/python-anti-patterns-and-typo

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 3, 2026

Good day,

Summary

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

3. Remove duplicate rrf entry in docstring

  • demo/utils/simple_memory_manager.py (line 251)
  • Clarified the remaining rrf description as Keyword + Vector + Reciprocal Rank Fusion

Testing

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

Related Issues

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

Warmly,
Taizi

1. Replace == None with is None (PEP 8 compliance)
   - src/biz_layer/mem_memorize.py (lines 1293, 1329, 1348)

2. Replace bare except with except Exception
   - 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

3. Remove duplicate rrf mode description
   - demo/utils/simple_memory_manager.py (docstring cleanup)

Testing: Python syntax validation passed (python3 -m py_compile)
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