Skip to content

[Plugin Protocol] Make BaseBuildPlugin generic with the Context Type#176

Open
JulienArzul wants to merge 1 commit intomainfrom
make-build-plugin-generic-with-the-context-type
Open

[Plugin Protocol] Make BaseBuildPlugin generic with the Context Type#176
JulienArzul wants to merge 1 commit intomainfrom
make-build-plugin-generic-with-the-context-type

Conversation

@JulienArzul
Copy link
Copy Markdown
Collaborator

What?

Since we now know the context_type, this PR actually uses it in the Plugin's protocol, so that all the methods can return the right type.

e.g: the declared context_type is now the type returned by build_context

@JulienArzul
Copy link
Copy Markdown
Collaborator Author

The change is trying to help the plugins type themselves better and avoid errors due to Any. But in the end, it looks like mypy ignores that generic type in some cases... So I'm not sure how interesting it is to declare (it makes the classes and especially the class hierarchy a bit more complex...

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