Skip to content

fix: super().__init__ does not need self#2359

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:super_no_self
Jul 12, 2022
Merged

fix: super().__init__ does not need self#2359
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:super_no_self

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Jul 12, 2022

super().__init__(self) results in a call to UIGraphicsItem.__init__(self, bounds=self, parent=None)

UIGraphicsItem expects "bounds" to be a QRectF and assigns it to "self._bounds".
("self._bounds" ends up not being used at all, but that's another issue...)

At worst, the bug here causes a cyclic reference.

super().__init__(self) results in a call to
UIGraphicsItem.__init__(self, bounds=self, parent=None)

UIGraphicsItem expects "bounds" to be a QRectF and assigns it to
"self._bounds".
("self._bounds" ends up not being used at all, but that's another
issue...)

At worst, the bug here causes a cyclic reference.
@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jul 12, 2022

Nice catch @pijyoi Merging!

@j9ac9k j9ac9k merged commit 5e75cfc into pyqtgraph:master Jul 12, 2022
@pijyoi pijyoi deleted the super_no_self branch July 12, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants