We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calling repr(Image()) will raise an error:
repr(Image())
>>> from wand.image import Image >>> i = Image() >>> print(i.wand) 820470904512 >>> print(i.signature) None >>> repr(i) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\roeland\Documents\dev\wand\wand\image.py", line 3162, in __repr__ self.signature[:7], self.format, self.width, self.height TypeError: 'NoneType' object is not subscriptable
The text was updated successfully, but these errors were encountered:
It's true that this use-case should be handled better. The __repr__ method should expect null structures.
__repr__
with Image() as i: print(i.wand) # Should give wand structure pointer. => '0xbf07e076c0' print(i.signature) # No authenticated/cache pixels, so 'None' is expected. repr(i) # Empty MagicWand structure. => '???' repr(i) # Deallocated structure. => '<wand.image.Image: (closed)>'
So I should ask. What should repr string be for the allocated, but uninitialized wand instant?
repr
Perhaps <wand.image.Image: (empty)>, or <wand.image.Image: (alloc)>?
<wand.image.Image: (empty)>
<wand.image.Image: (alloc)>
Sorry, something went wrong.
<wand.image.Image: (empty)> seems fine.
Fix repr() for empty images. Fix #265
2edc311
dahlia
No branches or pull requests
calling
repr(Image())
will raise an error:The text was updated successfully, but these errors were encountered: