Use f-strings instead of .format
See original GitHub issuePython 3.6+ supports a new style of string formatting which reads much easier.
uri = urlparse("{}://{}".format(scheme, connect_url))
becomes
uri = urlparse(f'{scheme}://{connect_url}')
This reads nicer in areas like the protocol where we are concatting strings with +
as well.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Python 3's f-Strings: An Improved String Formatting Syntax ...
As of Python 3.6, f-strings are a great new way to format strings. Not only are they more readable, more concise, and less...
Read more >f-strings vs str.format() - Stack Overflow
I'm using the .format() a lot in my Python 3.5 projects, but I'm afraid that it will be deprecated during the next Python...
Read more >A Guide to Formatting with f-strings in Python - CIS Sandbox
To use formatted string literals, begin a string with f or F before the opening quotation mark or triple quotation mark in a...
Read more >Python f-String Tutorial – String Formatting in ... - freeCodeCamp
But in Python 3.6 and later, you can use f-Strings instead. f-Strings, also called formatted string literals, have a more succinct syntax ...
Read more >f-strings in Python - GeeksforGeeks
To create an f-string, prefix the string with the letter “ f ”. The string itself can be formatted in much the same...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep no rush, totally a cosmetic update.
Yeah I’m pretty sure we are already using some things that bind us to 3.6 or later. Closing as addressed in #152