Skip to content

Fix invalid overrides of mistune methods#1377

Open
quis wants to merge 1 commit into
mainfrom
fix-mistune-overrides
Open

Fix invalid overrides of mistune methods#1377
quis wants to merge 1 commit into
mainfrom
fix-mistune-overrides

Conversation

@quis

@quis quis commented Jun 18, 2026

Copy link
Copy Markdown
Member

When overriding a method the type signature (including the names of arguments should be the same).

This commit fixes warnings like these emitted by a type checker:

error[invalid-method-override]: Invalid override of method `link`
   --> notifications_utils/markdown.py:126:9
    |
126 |     def link(self, link, title, content):
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Renderer.link`
    |
   ::: /Users/chris.hill-scott/.pyenv/versions/3.13.2/envs/notifications-utils-3.13/lib/python3.13/site-packages/mistune.py:879:9
    |
879 |     def link(self, link, title, text):
    |         ----------------------------- `Renderer.link` defined here
    |

When overriding a method the type signature (including the names of
arguments should be the same).

This commit fixes warnings like these emitted by a type checker:

```
error[invalid-method-override]: Invalid override of method `link`
   --> notifications_utils/markdown.py:126:9
    |
126 |     def link(self, link, title, content):
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Definition is incompatible with `Renderer.link`
    |
   ::: /Users/chris.hill-scott/.pyenv/versions/3.13.2/envs/notifications-utils-3.13/lib/python3.13/site-packages/mistune.py:879:9
    |
879 |     def link(self, link, title, text):
    |         ----------------------------- `Renderer.link` defined here
    |
```
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.

1 participant