Skip to content

Commit 6800eec

Browse files
committed
Remove _BaseHDU.__new__
The HDU class detection is already done in _readfrom_internal, I cannot see why doing it twice is necessary. And no test fail because of this :)
1 parent ad4d7b2 commit 6800eec

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

‎astropy/io/fits/hdu/base.py‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,6 @@ class _BaseHDU(metaclass=_BaseHDUMeta):
135135

136136
_header = _DelayedHeader()
137137

138-
def __new__(cls, data=None, header=None, *args, **kwargs):
139-
"""
140-
Iterates through the subclasses of _BaseHDU and uses that class's
141-
match_header() method to determine which subclass to instantiate.
142-
143-
It's important to be aware that the class hierarchy is traversed in a
144-
depth-last order. Each match_header() should identify an HDU type as
145-
uniquely as possible. Abstract types may choose to simply return False
146-
or raise NotImplementedError to be skipped.
147-
148-
If any unexpected exceptions are raised while evaluating
149-
match_header(), the type is taken to be _CorruptedHDU.
150-
"""
151-
152-
klass = _hdu_class_from_header(cls, header)
153-
return super().__new__(klass)
154-
155138
def __init__(self, data=None, header=None, *args, **kwargs):
156139
if header is None:
157140
header = Header()

0 commit comments

Comments
 (0)