Skip to content

fix: use actual class name in CurvesAsSubmobjects error messages - #5013

Open
Selahattinozdmr wants to merge 1 commit into
ManimCommunity:mainfrom
Selahattinozdmr:fix/curves-as-submobjects-class-name
Open

fix: use actual class name in CurvesAsSubmobjects error messages#5013
Selahattinozdmr wants to merge 1 commit into
ManimCommunity:mainfrom
Selahattinozdmr:fix/curves-as-submobjects-class-name

Conversation

@Selahattinozdmr

Copy link
Copy Markdown

Summary

_throw_error_if_no_submobjects and _get_submobjects_with_points on CurvesAsSubmobjects hardcoded the literal string "CurvesAsSubmobjects" in their error messages instead of deriving it from type(self).__name__. So a subclass calling these methods with no submobjects/points would get a misleading error naming the wrong class.

Fixes #4983

Changes

  • Use type(self).__name__ instead of the hardcoded class name in both error messages.
  • Added a regression test (test_curves_as_submobjects_error_messages_use_actual_class_name) that subclasses CurvesAsSubmobjects and 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_submobjects passes (2 passed)
  • ruff check / ruff format --check clean

🤖 Generated with Claude Code

@Selahattinozdmr
Selahattinozdmr force-pushed the fix/curves-as-submobjects-class-name branch from 3aca376 to 30fe66a Compare September 13, 2026 11:30
_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
Selahattinozdmr force-pushed the fix/curves-as-submobjects-class-name branch from 30fe66a to d4c613c Compare September 13, 2026 11:42
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.

CurvesAsSubmobjects error messages contain hardcoded class names

1 participant