jinja
jinja copied to clipboard
Fix return value annotations for methods returning copies
These methods always return a new object of the same type as the object they are bound to, even if this is a subclass. Change the annotations to reflect that.
I have not opened an issue, because it's not a functional bug. It just causes issues with static type checkers.
Checklist:
- [ ] Add tests that demonstrate the correct behavior of the change. Tests should fail without the change. (N/A)
- [ ] Add or update relevant docs, in the docs folder and in code. (N/A)
- [x] Add an entry in
CHANGES.rstsummarizing the change and linking to the issue. - [ ] Add
.. versionchanged::entries in any relevant code docs. (N/A) - [x] Run
pre-commithooks and fix any issues. - [x] Run
pytestandtox, no tests failed.
The pre-commit failure is not related to the changes in the PR and also happens with the current state of the branch.