From a6c32b25e5ca0ff369b70a6e2ba660ac251fe2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 5 Apr 2017 12:28:31 +0200 Subject: [PATCH] Added BlendFile.__repr__() to show more useful info than memory pointer --- bam/blend/blendfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bam/blend/blendfile.py b/bam/blend/blendfile.py index 2e98544..a61ee7b 100644 --- a/bam/blend/blendfile.py +++ b/bam/blend/blendfile.py @@ -143,6 +143,9 @@ class BlendFile: # cache (could lazy init, incase we never use?) self.block_from_offset = {block.addr_old: block for block in self.blocks if block.code != b'ENDB'} + def __repr__(self): + return '<%s %r>' % (self.__class__.__qualname__, self.handle) + def __enter__(self): return self