Code Check and Optimize
When analyzing and improving code, perform the following actions:
- •Fix any errors: Identify and resolve syntax errors, logical bugs, and runtime issues.
- •Add proper type hints: Ensure all function arguments and return values have precise type annotations.
- •Add documentation and comments:
- •Add docstrings to modules, classes, and functions.
- •Add inline comments for complex logic.
- •Improve code structure and readability:
- •Refactor long functions.
- •Improve variable and function naming.
- •Ensure consistent formatting.
- •Follow best practices and coding standards:
- •Adhere to PEP 8 (for Python) or relevant style guides.
- •Use appropriate design patterns.