Skip to content

Annotation Problem *.pyi #26673

@Roffild

Description

@Roffild

🚀 Feature

It is difficult to control the validity of function arguments when they are in different files.
Very often the information in *.pyi does not match *.py.

class _DataLoaderIter:

I suggest using Python 2 Annotations:

def optional_unwrap (self, x, y):
   # type: (Optional [int], Optional [int]) -> int

You can expand this format to indicate in which file to place annotations.
After that, all *.pyi can be completely assembled in one script. Information will always be up to date.

cc @ezyang @gchanan @zou3519

Metadata

Metadata

Assignees

Labels

high prioritymodule: typingRelated to mypy type annotationstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions