Skip to content

test: use zero-argument super() shortcut (Python 3.0+) - #18585

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
theStack:20201004-test-use-python3-non-zero-arg-super
Apr 25, 2020
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
theStack:20201004-test-use-python3-non-zero-arg-super

Conversation

@theStack

Copy link
Copy Markdown
Contributor

This mini-PR replaces all calls to super(...) with arguments with the zero-argument shortcut super() where applicable. See PEP 3135:

The new syntax:

super()

is equivalent to:

super(__class__, <firstarg>)

where class is the class that the method was defined in, and is
the first parameter of the method (normally self for instance methods, and cls
for class methods).

@DrahtBot

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@fanquake

Copy link
Copy Markdown
Member

Concept ACK

as defined in PEP 3135:

"The new syntax:

    super()

is equivalent to:

    super(__class__, <firstarg>)

where __class__ is the class that the method was defined in, and <firstarg> is
the first parameter of the method (normally self for instance methods, and cls
for class methods)."
@theStack
theStack force-pushed the 20201004-test-use-python3-non-zero-arg-super branch from 7322989 to 0956e46 Compare April 25, 2020 11:50
@theStack

Copy link
Copy Markdown
Contributor Author

Rebased.

@fanquake fanquake left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK 0956e46

@maflcko
maflcko merged commit fd48e7a into bitcoin:master Apr 25, 2020
@theStack
theStack deleted the 20201004-test-use-python3-non-zero-arg-super branch December 1, 2020 09:55
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 21, 2021
Summary:
> as defined in PEP 3135:
>
> "The new syntax:
>
>     super()
>
> is equivalent to:
>
>     super(__class__, <firstarg>)
>
> where __class__ is the class that the method was defined in, and <firstarg> is
> the first parameter of the method (normally self for instance methods, and cls
> for class methods)."

This is a backport of Core [[bitcoin/bitcoin#18585 | PR18585]]

Test Plan:
`grep "super(.*, self)" test/functional/*`
`ninja check-functional-extended`

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8988
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants