Skip to content
Open
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: 3 additions & 0 deletions python_files/pythonrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def __str__(self):

return result

def __repr__(self):
return "<Custom PS1 for VS Code Python Shell Integration>"
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The __repr__ method should follow Python conventions by including the class name. A typical pattern for __repr__ when the object cannot be recreated from the string is <ClassName: description>. Consider changing this to something like <PS1: Custom PS1 for VS Code Python Shell Integration> or <pythonrc.PS1 object at {hex(id(self))}> to make it clearer what type of object this represents.

Suggested change
return "<Custom PS1 for VS Code Python Shell Integration>"
return "<PS1: Custom PS1 for VS Code Python Shell Integration>"

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +79
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The new __repr__ method lacks test coverage. Since the PS1 class already has comprehensive tests in test_shell_integration.py covering __str__ and other functionality, a test should be added to verify that repr(ps1) returns the expected string representation. This ensures the debugging enhancement mentioned in the PR description works as intended.

Copilot uses AI. Check for mistakes.


if sys.platform != "win32" and (not is_wsl):
sys.ps1 = PS1()
Expand Down