Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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.
class Localizer(Protocol):
def localize(self, msg: str) -> str:
pass
def localize(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
Contributor Author

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.

@faif faif merged commit 25c7356 into faif:master Oct 17, 2025
3 of 9 checks passed
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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.