Skip to content

Conversation

@Sorrow-Scarlet
Copy link
Contributor

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.

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.
classLocalizer(Protocol):
deflocalize(self, msg: str) ->str:
pass
deflocalize(self, msg: str) ->str: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - definitely more in line with modern usage. However; shouldn't the ellipsis go on the next line?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I equipped black formatter as requested.
Black formatter insists that ellipsis go the exact same line with the function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

@faiffaif merged commit 25c7356 into faif:masterOct 17, 2025
3 of 9 checks passed
Sign up for freeto 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.

3 participants

@Sorrow-Scarlet@grimley517@faif