Skip to content
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

change super() syntax #4707

Merged
merged 1 commit into from Aug 4, 2020
Merged

Conversation

noviluni
Copy link
Member

@noviluni noviluni commented Jul 30, 2020

As a way to modernize the code, I changed the super() syntax to the Python 3 super() syntax. I think this syntax it’s easier to read and write and looks cleaner.

@@ -151,7 +151,7 @@ class FilesystemStorageGzipTest(FilesystemStorageTest):

def _get_settings(self, **new_settings):
new_settings.setdefault('HTTPCACHE_GZIP', True)
return super(FilesystemStorageTest, self)._get_settings(**new_settings)
return super()._get_settings(**new_settings)
Copy link
Member Author

@noviluni noviluni Jul 30, 2020

Choose a reason for hiding this comment

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

As you can see, originally, this super() was referring to the FilesystemStorageTest superclass instead of FilesystemStorageGzipTest, but it's the same (FilesystemStorageTest doesn't implement its own ._get_settings() method) so I decided to keep it as simply super().

@codecov
Copy link

codecov bot commented Jul 30, 2020

Codecov Report

Merging #4707 into master will increase coverage by 0.12%.
The diff coverage is 95.71%.

@@            Coverage Diff             @@
##           master    #4707      +/-   ##
==========================================
+ Coverage   86.18%   86.30%   +0.12%     
==========================================
  Files         160      160              
  Lines        9632     9669      +37     
  Branches     1414     1419       +5     
==========================================
+ Hits         8301     8345      +44     
+ Misses       1071     1063       -8     
- Partials      260      261       +1     
Impacted Files Coverage Δ
scrapy/commands/view.py 58.33% <0.00%> (ø)
scrapy/exporters.py 100.00% <ø> (ø)
scrapy/utils/serialize.py 93.54% <0.00%> (ø)
scrapy/exceptions.py 92.59% <50.00%> (ø)
scrapy/contracts/default.py 84.61% <100.00%> (ø)
scrapy/core/downloader/contextfactory.py 90.00% <100.00%> (ø)
scrapy/core/downloader/handlers/http11.py 93.03% <100.00%> (ø)
scrapy/core/downloader/tls.py 86.04% <100.00%> (ø)
scrapy/core/spidermw.py 100.00% <100.00%> (ø)
scrapy/crawler.py 88.26% <100.00%> (ø)
... and 33 more

@noviluni noviluni changed the title change super syntax change super() syntax Jul 30, 2020
wRAR
wRAR approved these changes Jul 31, 2020
@wRAR wRAR added the cleanup label Jul 31, 2020
@Gallaecio Gallaecio merged commit 336f19f into scrapy:master Aug 4, 2020
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants