Repository navigation
Ensure fits Header subclasses are preserved on slicing and copying - #9229
Conversation
With the __new__ method, we ensure the old behaviour of returning a Header instance is kept.
05fe0a3 to
fea594d
Compare
|
The change looks reasonable, however I wonder if it's worth it to make I'm really conservative if it comes to |
|
@MSeifert04 - I subclass It is partially because the |
|
Ah, thanks for the examples. 👍 |
|
This looks good to me, subclassing |
|
Approved, so I merge it now. Thanks @mhvk! |
This PR makes
Headersub-class safe, by ensuring that__getitem__andcopyreturn aself.__class__instance rather than aHeaderinstance. It adds a(nother) hack toCompImageHeaderto ensure that for that case slicing and copying continues to return aHeaderinstance.fixes #7379