Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ This demonstrates successful translation of:
pytocplusplus/
├── src/
│ ├── analyzer/ # Python code analysis components
│ │ ├── code_analyzer.py # Original analyzer with bug
│ │ └── code_analyzer_fixed.py # Fixed implementation
│ │ └── code_analyzer_fixed.py # Analyzer implementation
│ ├── converter/ # C++ conversion components
│ │ ├── code_generator.py # Original generator
│ │ └── code_generator_fixed.py # Fixed implementation
Expand Down
2 changes: 1 addition & 1 deletion docs/core_bug_and_testing_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ a, b = 0, 1 # This causes: AttributeError: 'Tuple' object has no attribute 'id'

This error prevents the tool from processing any Python code with tuple assignments—a common pattern in Python. Since the Fibonacci example uses tuple unpacking, the tool fails to analyze even the simplest example provided.

The bug occurs in `src/analyzer/code_analyzer.py` in the `_infer_variable_type` method when handling tuple assignments. The code attempts to access an 'id' attribute on an AST.Tuple node, which doesn't exist:
The bug occurred in the now-deprecated `src/analyzer/code_analyzer.py` in the `_infer_variable_type` method when handling tuple assignments. The code attempted to access an 'id' attribute on an AST.Tuple node, which doesn't exist:

```python
self.type_info[node.targets[0].id] = f'std::tuple<{", ".join(elt_types)}>'
Expand Down
Loading