Skip to content

Add correct optional default start/end parameters to str count, find,… #1109

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

Merged
merged 1 commit into from
Mar 28, 2017

Conversation

gwk
Copy link
Contributor

@gwk gwk commented Mar 28, 2017

… index, rfind, rindex.

This supersedes PR #1107, and fixes #1108.

I reviewed the corresponding annotations for byte and bytearray; they look correct but use the x: int = None style which @JelleZijlstra says is discouraged. Perhaps those should be cleaned up separately?

@JelleZijlstra
Copy link
Member

Thanks, this looks fine to me but I'll wait for @gvanrossum before merging.

@gwk
Copy link
Contributor Author

gwk commented Mar 28, 2017

Also filed #1110 for the remaining __index__ concern, which I cannot take on at this point in time.

@gvanrossum
Copy link
Member

OK, but...

  • This also needs to happen for Python 2
  • These functions only take keyword args -- by convention we'd use __start etc.

@gwk gwk force-pushed the pr-str-methods branch from 1e4d9c7 to 2941896 Compare March 28, 2017 16:31
@gwk
Copy link
Contributor Author

gwk commented Mar 28, 2017

@gvanrossum just pushed an updated commit addressing your concerns.

@gvanrossum gvanrossum merged commit 18cc2cb into python:master Mar 28, 2017
@gvanrossum
Copy link
Member

Thanks for the quick response!

@gwk gwk deleted the pr-str-methods branch February 5, 2018 17:54
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.

str.count annotation is missing optional parameters.
3 participants