You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
urls = list(self.gen_urls(text))
return urls if not only_unique else list(set(urls))
The above has an issue in that it needlessly creates the initial list even when a set is desired. This can be wasteful of memory. I didn't realize this before, but a better form is:
The above has an issue in that it needlessly creates the initial list even when a set is desired. This can be wasteful of memory. I didn't realize this before, but a better form is:
The above form prevents creating a list of possibly non-unique URLs if only the unique ones are desired.
The text was updated successfully, but these errors were encountered: