From aaac2d2af991cd64aa9633faa97404063d73a296 Mon Sep 17 00:00:00 2001 From: Sorrow-Work <61646954+Sorrow-Scarlet@users.noreply.github.com> Date: Wed, 15 Oct 2025 13:21:00 +0800 Subject: [PATCH] fix: :bug: Fix potential warning in factory.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use ellipsis replace pass to avoid potential warning: ``` "resource": "/d:/Github/Python/python-patterns/patterns/creational/factory.py", "owner": "pylance4", "value": "reportReturnType", "path": "/microsoft/pylance-release/blob/main/docs/diagnostics/reportReturnType.md", "severity": 8, "message": "Function with declared return type \"str\" must return value on all code paths\n  \"None\" is not assignable to \"str\"", "source": "Pylance", "startLineNumber": 29, "startColumn": 37, "endLineNumber": 29, "endColumn": 40, "origin": "extHost1" }] ``` Using VS Code with Pylance, Python debugger, and Black Formatter. --- patterns/creational/factory.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/patterns/creational/factory.py b/patterns/creational/factory.py index 3ef2d2a8..e5372ca5 100644 --- a/patterns/creational/factory.py +++ b/patterns/creational/factory.py @@ -26,8 +26,7 @@ class Localizer(Protocol): - def localize(self, msg: str) -> str: - pass + def localize(self, msg: str) -> str: ... class GreekLocalizer: