Skip to content

Replace types string with str. - #2579

Merged
dhermes merged 4 commits into
googleapis:masterfrom
tswast:str-not-string
Oct 21, 2016
Merged

Replace types string with str.#2579
dhermes merged 4 commits into
googleapis:masterfrom
tswast:str-not-string

Conversation

@tswast

Copy link
Copy Markdown
Contributor

Based on this comment: #2485 (comment)

For rtypes, used the command:

ag -l 'rtype: string' | xargs sed -i .bak 's/rtype: string/rtype: str/g'

For types, used the command:

ag -l 'type ([^:]+): string' | \
xargs gsed -r -i.bak -e 's/type ([^:]+): string/type \1: str/g'

Note: -r for gsed (GNU sed) is needed for group matching.

Used the command:
ag -l 'rtype: string' | xargs sed -i .bak 's/rtype: string/rtype: str/g'
Based on this comment:
googleapis#2485 (comment)
`str` is a type, `string` is a module.
Uses command:
ag -l 'type ([^:]+): string' | \
xargs gsed -r -i.bak -e 's/type ([^:]+): string/type \1: str/g'
Note: [-r for gsed (GNU sed) is needed for group
matching](http://superuser.com/a/336819/125262).
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 20, 2016
@theacodes

Copy link
Copy Markdown
Contributor

😆

"""ID for the dataset resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Uses the command:
ag -l 'type ([^:]+): boolean' | \
xargs gsed -r -i.bak -e 's/type ([^:]+): boolean/type \1: bool/g'

@dhermesdhermes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I actually reviewed every line. Why? Because I'm crazy.

LGTM

(I think it'll be hilarious if Travis / Sphinx barfs on this.)

Uses the command:
ag -l 'rtype: boolean' | xargs sed -i .bak 's/rtype: boolean/rtype: bool/g'
@tswast

Copy link
Copy Markdown
ContributorAuthor

Thanks. For reviewing. I just added some commits for boolean -> bool, too, based on #2485 (comment)

@dhermes

Copy link
Copy Markdown
Contributor

Thanks. For reviewing. I just added some commits for boolean -> bool, too

GAH! Next time, please "heads up new code" first, then push to the PR. (Since review already finished.) Preference: send two PRs.

@dhermes

Copy link
Copy Markdown
Contributor

@tswast bool stuff looks good too. Ping me (or @jonparrott) when Travis is green?

@tswast

Copy link
Copy Markdown
ContributorAuthor

Works for me. (Two PRs next time and pinging for Travis)

@dhermes
dhermes merged commit 22941e2 into googleapis:masterOct 21, 2016
@tswast
tswast deleted the str-not-string branch October 21, 2016 16:07
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
parthea pushed a commit that referenced this pull request Jun 4, 2023
parthea pushed a commit that referenced this pull request Oct 21, 2023
parthea pushed a commit that referenced this pull request Oct 21, 2023
parthea pushed a commit that referenced this pull request Nov 22, 2025
parthea pushed a commit that referenced this pull request Nov 24, 2025
parthea pushed a commit that referenced this pull request Nov 24, 2025
parthea pushed a commit that referenced this pull request Nov 24, 2025
parthea pushed a commit that referenced this pull request Nov 24, 2025
parthea pushed a commit that referenced this pull request Nov 24, 2025
parthea pushed a commit that referenced this pull request Mar 2, 2026
parthea pushed a commit that referenced this pull request Mar 9, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@tswast@theacodes@dhermes@googlebot