Skip to content
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

Readability and branching Improvements #263

Closed
wants to merge 4 commits into from

Conversation

kokroo
Copy link

@kokroo kokroo commented Nov 26, 2024

Deleted

The Path() constructor already handles both str and Path types effectively.
Added a check to ensure the provided suffix starts with a dot (.), which is standard for file extensions.
This prevents the creation of invalid file paths with malformed suffixes (e.g., .txt vs txt).

Path(should_be_path).with_suffix(suffix) is directly applied, reducing the number of steps.
Combined checks for str, int, and tuple into a single isinstance call using a tuple of types.
This reduces redundancy, improves clarity and performance . The TypeError is preserved to handle unsupported types.

Added the correct return type (str).
This function is no longer needed.
@kokroo kokroo changed the base branch from main to develop November 26, 2024 17:11
@kokroo kokroo mentioned this pull request Nov 26, 2024
@kokroo kokroo marked this pull request as draft November 26, 2024 18:17
@kokroo kokroo closed this Nov 26, 2024
@kokroo kokroo deleted the improvements branch November 26, 2024 18:19
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.

1 participant