Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule.endpoint type annotation doesn't comply with the documentation #2836

Open
jkhsjdhjs opened this issue Jan 12, 2024 · 0 comments
Open

Rule.endpoint type annotation doesn't comply with the documentation #2836

jkhsjdhjs opened this issue Jan 12, 2024 · 0 comments

Comments

@jkhsjdhjs
Copy link
Contributor

jkhsjdhjs commented Jan 12, 2024

According to the documentation, anything can be used as a Rule endpoint: https://werkzeug.palletsprojects.com/en/3.0.x/routing/#werkzeug.routing.Rule

The endpoint for this rule. This can be anything. A reference to a function, a string, a number etc. The preferred way is using a string because the endpoint is used for URL generation.

However, the type is annotated as str | None:

endpoint: str | None = None,

self.endpoint: str = endpoint # type: ignore

The same applies to the parameter endpoint of MapAdapter.build() (and possibly more):

endpoint: str,

Environment:

  • Werkzeug version: 3.0.1
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

No branches or pull requests

1 participant