Skip to content

Type annotation for Python based Algorithms #125

Open

Description

@UbadahJ

Description

Most of the python-based algorithms are not annotated by types as specified by PEP 483 and PEP 484

Using generic types to provide these improvements is an effective way to enforce good practices and provide general documentation for other users quickly.

Implementation

This can be discussed using central generic types with specifically defined types for only those algorithms that work on some certain types (like counting sort) or each file having its independent types

Activity

  1. UbadahJ commented on Sep 30, 2020

    @UbadahJ
    ContributorAuthor

    @diptangsu What do you think about which approach should be taken?

    • Single file with all generics and specialized one in individual files
    • Each file with its own type defined

    Both have there pros and cons and personally I am thinking of going with second option to make the code completely independent at the cost of duplication

  2. diptangsu commented on Sep 30, 2020

    @diptangsu
    Owner

    I also think we should go with each file having its own annotations.
    Anyone who wants to only look at one code won't have to look elsewhere.
    And most of the lists would anyway be List[Any] haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions