Python Forum
Git clone all of a Github user's public repositories (download all repositories)
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Git clone all of a Github user's public repositories (download all repositories)
#24
Quote:Is there any real difference as far as performance goes? Or is just being used because it's easier to format?

Since string expressions were the main method in python2.x and 2.x is soon to be dead finally, since everyone is using python3.x now, that string expressions at some point might become obsolete and unsupported. If that does happen you would have to rewrite all your code to use at least the format method or force users to run an old version to support your string expressions. At this point it is not runnable in python3.x because everyone wants it, its mainly just for backwards compatibility. And it wouldnt surprise me that they remove it at some point in time.

Also by appearance, your code, since using string expressions looks old...meaning at first glance you would think your code only supports python 2.

Also I would call it unpythonic to use string expressions now. But that might be up to interpretation.

f strings are the even newer way in python 3.6+ would turn this
site = '{w3}{0}{tld}'
>>> site.format('metulburr',w3='www.',tld='.com')
'www.metulburr.com'
into this
>>> w3 = 'www.'
>>> name = 'metulburr'
>>> tld = '.com'
>>> site = f'{w3}{name}{tld}'
>>> site
'www.metulburr.com'
(Jul-20-2019, 05:20 PM)rootVIII Wrote: As far as readability goes
Thats odd. I find format method to be much more readable than string expressions. You are the first one i have heard to prefer string expressions over format.
Recommended Tutorials:
Reply


Messages In This Thread
RE: Git clone all of a Github user's public repositories (download all repositories) - by metulburr - Jul-20-2019, 06:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pong clone with classes OhNoSegFaultAgain 1 3,935 May-11-2019, 07:44 PM
Last Post: keames

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020