##// END OF EJS Templates
Do not record memory addresses of display objects in repr
Jessica B. Hamrick -
Show More
@@ -299,6 +299,7 b' class DisplayObject(object):'
299 299 """An object that wraps data to be displayed."""
300 300
301 301 _read_flags = 'r'
302 _show_mem_addr = False
302 303
303 304 def __init__(self, data=None, url=None, filename=None):
304 305 """Create a display object given raw data.
@@ -336,6 +337,14 b' class DisplayObject(object):'
336 337 self.reload()
337 338 self._check_data()
338 339
340 def __repr__(self):
341 if not self._show_mem_addr:
342 cls = self.__class__
343 r = "<%s.%s object>" % (cls.__module__, cls.__name__)
344 else:
345 r = super(DisplayObject, self).__repr__()
346 return r
347
339 348 def _check_data(self):
340 349 """Override in subclasses if there's something to check."""
341 350 pass
General Comments 0
You need to be logged in to leave comments. Login now