Skip to content

Remove duplicate __all__ declarations in vectorized_mobject.py #4108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

irvanalhaq9
Copy link
Contributor

Overview: What does this pull request change?

This pull request removes duplicate __all__ declarations and redundant entries within the vectorized_mobject.py module. By consolidating the exports list into a single __all__, this change ensures clarity, avoids confusion, and eliminates unnecessary duplication.

Motivation and Explanation: Why and how do your changes improve the library?

Why:
Having multiple __all__ declarations in the same module is unnecessary and can create ambiguity. Moreover, redundant entries such as VectorizedPoint within the list serve no functional purpose and can confuse contributors or maintainers.
By consolidating __all__ into a single declaration and removing duplicates, this change aligns with Python's best practices for maintaining clean and readable code.

How:
This change:
Merges the two __all__ declarations into a single list at the top of the module.
Removes duplicate entries such as VectorizedPoint from the export list.
Ensures the final __all__ is clear, concise, and reflective of intended exports.

Links to added or changed documentation pages

Further Information and Comments

This is a non-breaking, backward-compatible change. It does not modify exported functionality but improves the codebase's maintainability by ensuring consistency and reducing redundancy.
Feedback or further suggestions are welcome!

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

"VectorizedPoint",
"DashedVMobject",
]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The __all__ declaration already exists at the top of this file, specifically in lines 5–12.
This duplicate declaration is unnecessary and could lead to confusion. It would be better to consolidate the exports into a single __all__ definition at the beginning of the file. Original declaration in the main branch: vectorized_mobject.py.

@behackl behackl added the enhancement Additions and improvements in general label Jan 19, 2025
@behackl behackl added this to the v0.19.0 milestone Jan 19, 2025
Copy link
Member

@behackl behackl left a comment

Choose a reason for hiding this comment

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

Well spotted and thanks for your contribution! This looks fine to me.

@behackl behackl merged commit 9e45cf6 into ManimCommunity:main Jan 19, 2025
20 of 21 checks passed
@irvanalhaq9 irvanalhaq9 deleted the fix-duplicate-all branch January 20, 2025 07:53
@irvanalhaq9
Copy link
Contributor Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additions and improvements in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants