Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type annotation for Python based Algorithms #125

Open
UbadahJ opened this issue Sep 30, 2020 · 2 comments
Open

Type annotation for Python based Algorithms #125

UbadahJ opened this issue Sep 30, 2020 · 2 comments
Assignees

Comments

@UbadahJ
Copy link
Contributor

UbadahJ commented Sep 30, 2020

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

@UbadahJ
Copy link
Contributor Author

UbadahJ commented Sep 30, 2020

@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

@diptangsu
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants