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

Add fake f-strings to blurb. Works with 3.5! #288

Merged
merged 1 commit into from Sep 11, 2018

Conversation

Projects
None yet
6 participants
@larryhastings
Contributor

larryhastings commented Sep 10, 2018

No description provided.

@mariatta-bot

This comment has been minimized.

mariatta-bot commented Sep 10, 2018

Mariatta's review was requested, but she's out of open source for the rest of September 2018. Perhaps request a review from someone else, or wait until October.
(I'm a bot)

@Mariatta

This comment has been minimized.

Member

Mariatta commented Sep 10, 2018

How come travis CI is not run here?

@larryhastings

This comment has been minimized.

Contributor

larryhastings commented Sep 10, 2018

I don't know anything about it!

@vstinner

This comment has been minimized.

Member

vstinner commented Sep 11, 2018

I told @larryhastings that you get ride of Python 3.5 support if you want. I'm too lazy to check which operating systems don't provide Python 3.6 or newer. We can revert Python 3.5 support if we can too many complains :-)

@larryhastings

This comment has been minimized.

Contributor

larryhastings commented Sep 11, 2018

Yes, but I felt like rising to the challenge! This supports something very similar to f-strings, but still runs under 3.5. (I tested that!)

@larryhastings

This comment has been minimized.

Contributor

larryhastings commented Sep 11, 2018

I remind both of you that reviewing this PR would get you on the leaderboard for the dev sprints ;-)

@Mariatta

This comment has been minimized.

Member

Mariatta commented Sep 11, 2018

I don't know... this PR is quite evil literally.

I just want more people to install Python 3.6 :)

@ericvsmith

One little nit that doesn't need to be addressed (but I need to prove I read everything!). Looks good to me.

# else:
# print("NOT FIXING LINE {}: {!r}".format(line_number, line))
# print(f("NOT FIXING LINE {line_number}: {line!r}"))

This comment has been minimized.

@ericvsmith

ericvsmith Sep 11, 2018

Member

I admire your tenacity for even fixing the comments!

@@ -1601,10 +1628,10 @@ def main():
def handle_option(s, dict):
name = dict.get(s, None)
if not name:
sys.exit('blurb: Unknown option for {}: "{}"'.format(subcommand, s))
sys.exit(f('blurb: Unknown option for {subcommand}: "{s}"'))

This comment has been minimized.

@ericvsmith

ericvsmith Sep 11, 2018

Member

I would probably use {s!r} here instead of "{s}", but I realize it's outside the scope of your direct changes.

This comment has been minimized.

@larryhastings

larryhastings Sep 11, 2018

Contributor

You would change the name of the variable from s to str?

This comment has been minimized.

@ericvsmith

ericvsmith Sep 11, 2018

Member

No, I would use !r to add the quotes, instead of adding them manually. I realize it might change the type of quotes from double to single, based on what s contains.

This comment has been minimized.

@larryhastings

larryhastings Sep 11, 2018

Contributor

Oh! Sorry. Tiny font made s!r look like str on my screen.

@ericvsmith

This comment has been minimized.

Member

ericvsmith commented Sep 11, 2018

To address @vstinner 's comment: I think this is a reasonable change as an interim to using f-strings in the future. Once this is done, actually switching to f-strings is trivial.

@Mariatta

This comment has been minimized.

Member

Mariatta commented Sep 11, 2018

Just going to close and re-open the PR, hoping to re-trigger Travis CI.

@Mariatta Mariatta closed this Sep 11, 2018

@Mariatta Mariatta reopened this Sep 11, 2018

@larryhastings larryhastings merged commit a44b234 into python:master Sep 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment