[mypy] fix directory "dynamic_programming"#4323
[mypy] fix directory "dynamic_programming"#4323algobytewise wants to merge 3 commits intoTheAlgorithms:masterfrom
Conversation
|
We are not only correcting the I was already working on |
| value = [int(v) for v in value] | ||
| weight = input(f"Enter the positive weights of the {n} item(s) in order: ".split()) | ||
| weight = [int(w) for w in weight] | ||
| valueStrings = input(f"Enter the values of the {n} item(s) in order: ").split() |
There was a problem hiding this comment.
Python follows the snake_case naming convention.
|
|
||
| ; FIXME: #4052 fix mypy errors in the exclude directories and remove them below | ||
| exclude = (data_structures|dynamic_programming|graphs|maths|matrix|other|project_euler|searches|strings*)/$ | ||
| exclude = (data_structures|graphs|maths|matrix|other|project_euler|searches|strings*)/$ |
There was a problem hiding this comment.
Please remove this change as the directory is not completely typed.
There was a problem hiding this comment.
If we want to make sure that there are no untyped functions, we could use the additional parameter --disallow-untyped-defs, see https://mypy.readthedocs.io/en/stable/command_line.html#untyped-definitions-and-calls.
There was a problem hiding this comment.
Thank you looking into it. We are going to make mypy stricter, but not now.
|
Just to clarify: with getting "the entire codebase statically typed" I assume you mean all the inputs & outputs of functions and not truly everything. |
|
I do mean everything which Also, we should be using duck typings, generics and type variables where possible. Duck typings include the ones which define a certain behavior type and not a concrete type like |
|
Ah I see, that's good to know. |
|
Could someone have a look at this contribution? It fixes all the errors ( |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions! |
Describe your change:
Related Issue: #4052
Checklist:
Fixes: #{$ISSUE_NO}.