Skip to content

Using @override in stubs? #14750

@srittau

Description

@srittau

What's our policy on using @override in stubs? Should we use it (and add it in cases where it's not used currently) or should we disallow it?

In my opinion we shouldn't allow it, as we're just copying upstream signatures, so the error that this is designed to prevent does not exist in stubs and its usefulness for documentation purposes it dubious. And it would be a lot of work to add it to existing stubs. But I have no strong opinion about this.

In any case we should catch this is CI, whatever we decide on. Adding a check to flake8-pyi not to include @override would be straight-forward, adding a check that it is present if necessary would probably harder (and probably not possible in flake8-pyi).

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: policyOrganization of the typeshed project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions