Repository navigation
Conversation
Add explanatory comments next to the two intentional explicit base __init__ calls, to prevent them being re-reported / "simplified" to super().__init__() in future cleanups (see #5067). - `SplitScreenCamera`: Camera.__init__ is called first so self.pixel_width exists before half_width is computed; super() would dispatch to OldMultiCamera and raise AttributeError. - `Axes`: VGroup and CoordinateSystem are non-cooperative bases, so super() would follow only one MRO branch and skip CoordinateSystem.__init__, leaving the instance half-initialized. Comment-only change; no behaviour modified.
Contributor
|
good-first-issue's should be kept for humans. |
Author
|
@GniLudio still a good-first-issue? |
Contributor
You are welcome to contribute to manim, but I would recommend you to avoid relying on AI-agents too much for your first contribution, so that you can familiarize yourself with the codebase a bit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Comment-only change. Adds explanatory notes next to two intentional explicit base
__init__calls so they are not "simplified" tosuper().__init__()in future cleanups.Motivated by #5067, which proposed replacing every
Parent.__init__(self, ...)withsuper().__init__(...). Investigation there showed the pattern is intentional at the real call sites, and a mechanical replacement would break things. This PR documents why, so the question does not come up again.Details
manim/camera/mapping_camera.py—SplitScreenCameraThe explicit call must run before
super().__init__(...). Replacing it withsuper()would dispatch toOldMultiCamera(which expects positional camera tuples) andpixel_widthwould never be set, raisingAttributeError.manim/mobject/graphing/coordinate_systems.py—AxesVGroupandCoordinateSystemare non-cooperative bases, sosuper().__init__()follows only one MRO branch and skipsCoordinateSystem.__init__entirely, leaving the instance half-initialized. Minimal repro:Checklist
python -m py_compileParentClass.__init__(selfwithsuper().__init__#5067 aswontfixor reframe it as a larger cooperative-super()refactorCloses nothing on its own — left open pending #5067 direction.