fix: use actual class name in CurvesAsSubmobjects error messages - #5013
Open
Selahattinozdmr wants to merge 1 commit into
Open
fix: use actual class name in CurvesAsSubmobjects error messages#5013Selahattinozdmr wants to merge 1 commit into
Selahattinozdmr wants to merge 1 commit into
Conversation
Selahattinozdmr
force-pushed
the
fix/curves-as-submobjects-class-name
branch
from
September 13, 2026 11:30
3aca376 to
30fe66a
Compare
_throw_error_if_no_submobjects and _get_submobjects_with_points hardcoded the literal string "CurvesAsSubmobjects" instead of deriving it from type(self).__name__, so a subclass calling these methods would get an error naming the wrong class. Fixes ManimCommunity#4983
Selahattinozdmr
force-pushed
the
fix/curves-as-submobjects-class-name
branch
from
September 13, 2026 11:42
30fe66a to
d4c613c
Compare
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.
Summary
_throw_error_if_no_submobjectsand_get_submobjects_with_pointsonCurvesAsSubmobjectshardcoded the literal string"CurvesAsSubmobjects"in their error messages instead of deriving it fromtype(self).__name__. So a subclass calling these methods with no submobjects/points would get a misleading error naming the wrong class.Fixes #4983
Changes
type(self).__name__instead of the hardcoded class name in both error messages.test_curves_as_submobjects_error_messages_use_actual_class_name) that subclassesCurvesAsSubmobjectsand checks the error message names the subclass, not the base class.Test plan
pytest tests/module/mobject/types/vectorized_mobject/test_vectorized_mobject.py -k curves_as_submobjectspasses (2 passed)ruff check/ruff format --checkclean🤖 Generated with Claude Code