In safe_repr.py, ptvsd estimates whether repr (obj) might be too long to send to the IDE. In my code, I have a class derived from list, and if I have more than two levels of nesting, it is considered too long.
Please consider the following solution: If the obj being displayed has a method called 'safe_repr', then this is called directly. I put the following in my local copy of safe_repr.py:
def call(self, obj):
-
try: return obj.__safe_repr__ ()
-
The name 'safe_repr' is something I made up. You might want to provide some other way to tell SafeRepr (obj) that repr (obj) is OK to use.
Environment data
- VS Code version: 2017
- OS and version: Windows 10
- Python version: 3.7
In safe_repr.py, ptvsd estimates whether repr (obj) might be too long to send to the IDE. In my code, I have a class derived from list, and if I have more than two levels of nesting, it is considered too long.
Please consider the following solution: If the obj being displayed has a method called 'safe_repr', then this is called directly. I put the following in my local copy of safe_repr.py:
def call(self, obj):
The name 'safe_repr' is something I made up. You might want to provide some other way to tell SafeRepr (obj) that repr (obj) is OK to use.
Environment data