Corrected filename and include static types by NumberPiOso · Pull Request #2440 · TheAlgorithms/Python · GitHub
Skip to content

Corrected filename and include static types - #2440

Merged
cclauss merged 4 commits into
TheAlgorithms:masterfrom
NumberPiOso:update_binary
Sep 17, 2020
Merged

cclauss merged 4 commits into
TheAlgorithms:masterfrom
NumberPiOso:update_binary

Conversation

@NumberPiOso

@NumberPiOso NumberPiOso commented Sep 16, 2020

Copy link
Copy Markdown
Contributor

continuing in line with #2128.

My first time contributing code to open source so criticism is encouraged.

  • The name of the file is now compliant with python naming conventions
  • Add static type as stated in contributing guidelines

Describe your change:

  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.

- The name of the file is now compliant with python naming conventions
- Add static type as stated in contributing guidelines
@spamegg1

spamegg1 commented Sep 16, 2020

Copy link
Copy Markdown
Contributor

Comment thread searches/simple_binary_search.py Outdated
Comment thread searches/simple_binary_search.py Outdated
Comment thread searches/simple_binary_search.py Outdated
Comment thread searches/simple_binary_search.py Outdated
>>> print(binary_search(test_list, 3))
False
>>> print(binary_search(test_list, 13))
True

@cclauss cclauss Sep 16, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for negative integers, floats, repeated numbers, letters, empty list, single element list.

Comment thread searches/simple_binary_search.py Outdated
Comment thread searches/simple_binary_search.py Outdated
Comment thread searches/simple_binary_search.py Outdated
@NumberPiOso

Copy link
Copy Markdown
Contributor Author

NumberPiOso and others added 3 commits September 16, 2020 17:46
- Delete documentation line to run doctests
- Delete type hints for variables that comes from functions

Co-authored-by: Christian Clauss <cclauss@me.com>

@cclauss cclauss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It would be easier to review as two PRs. One that changed the filename and the other that changed the file contents.

@cclauss
cclauss merged commit 86fb299 into TheAlgorithms:master Sep 17, 2020
@NumberPiOso
NumberPiOso deleted the update_binary branch September 17, 2020 14:30
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Corrected name and include static types

- The name of the file is now compliant with python naming conventions
- Add static type as stated in contributing guidelines

* Apply suggestions from code review

- Delete documentation line to run doctests
- Delete type hints for variables that comes from functions

Co-authored-by: Christian Clauss <cclauss@me.com>

* Add edge cases tests.

* print(f"{target} was {not_str}found in {sequence}")

Co-authored-by: Christian Clauss <cclauss@me.com>
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 this pull request may close these issues.

3 participants