Interactive error handling and debugging for Python
Project description
Python Interactive Error Handling and Correction
This repository contains advanced tools for Python error handling and correction, designed to make Python development more efficient and user-friendly.
Decoher - Interactive Error Handling
Decoher provides interactive error handling capabilities for Python, allowing you to fix runtime errors on the fly without restarting your application.
Key Features
- ✅ Interactive error correction at runtime
- 🔄 Multiple correction options (fix single line, multiple lines, rewrite functions)
- 📝 Error fix history tracking
- 🛠️ Support for various error types:
- Syntax errors
- Indentation errors
- Name errors
- Type errors
- Attribute errors
- Import errors
- Index errors
- Key errors
- Zero division errors
- Value errors
- 🔍 Automatic detection and suggestions for whitespace issues
- 🔧 Automatic fix capabilities for common errors
- 📊 PEP 8 style suggestions
- 🔌 Simple enable/disable functionality
Basic Usage
from qfunc import decoher
# Enable interactive error handling
decoher.enable()
# Your code with potential errors
# When an error occurs, you'll get an interactive prompt to fix it
# Disable when done
decoher.disable()
# View history of fixes
decoher.show_fix_history()
Interactive Options
When an error is detected, Decoher provides several options:
- Apply automatic fix - For errors that can be automatically fixed
- Fix single line - Edit just the line with the error
- Fix multiple lines - Edit a range of lines
- Rewrite entire function - Replace the whole function containing the error
- Choose custom line range - Select specific lines to edit
- Show more context - View more lines around the error
- Continue execution - Ignore the error and continue
- Abort program - Stop execution
- Save a backup - Create a backup before making changes
- Show PEP 8 style suggestions - Get style recommendations
Error Detection and Correction
Decoher can detect and help fix various issues:
- Indentation errors: Automatically fixes unexpected indentation, missing indentation after colons, and inconsistent indentation levels
- Syntax errors: Suggests fixes for missing parentheses, quotes, colons, etc.
- Whitespace issues: Detects mixed tabs/spaces, trailing whitespace, and inconsistent indentation
- Variable errors: Suggests similar variable names when a name error occurs
- Type errors: Provides guidance on argument types and operation compatibility
Use Cases
- 🔰 Learning Python with reduced frustration
- ⚡ Rapid prototyping and debugging
- 🎬 Live coding demonstrations
- 👨🏫 Teaching and mentoring
- 🏛️ Legacy code maintenance
Limitations
- Not all errors can be fixed automatically
- Automatic fixes might not always match programmer intent
- Performance overhead during development
- Best used in development and educational contexts, not production
Best Practices
- Use during development for quick fixes
- Disable before deploying to production
- Use as a learning tool, not a substitute for proper coding practices
- Combine with proper linting tools for comprehensive code quality
##INSTALLATION
pip install qfunc
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qfunc-0.3.0.tar.gz.
File metadata
- Download URL: qfunc-0.3.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8774e4bde3a1d82fe192754ee9d6a4d5c261a479983bf294db0741d1baf1f5b4
|
|
| MD5 |
a60271fea8dfd689bfba0f9746c6986b
|
|
| BLAKE2b-256 |
73f27df1138419c414b82c56f2e3aeb4138e9cb5430e2a2d8b3a2d66a8ed2f8b
|
File details
Details for the file qfunc-0.3.0-py3-none-any.whl.
File metadata
- Download URL: qfunc-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d202bfdd61dff6fa405d9df7d28440f7a6cfb89cc4af1911aaa574ce330620e
|
|
| MD5 |
412814673cdac7b1a509427a2b5c9047
|
|
| BLAKE2b-256 |
20018080eb5d1e903ab3a3f0ea567a79042e5c8689a464db6b6ad60ad4b18730
|