@@ -269,8 +269,8 @@ def __init__(self, key, value_format, field_names=None):
269
269
self ._entry_length = struct .calcsize (value_format )
270
270
self .field_names = field_names
271
271
if field_names :
272
- # Mostly, this is to raise a ValueError if the passed-in field_names has invalid entries for later use.
273
- self .MDFTuple = namedtuple ("MDFTuple " , self .field_names )
272
+ # Mostly, this is to raise a ValueError if field_names has invalid entries
273
+ self .mdf_tuple = namedtuple ("mdf_tuple " , self .field_names )
274
274
275
275
def __get__ (self , obj , cls ):
276
276
if obj is None :
@@ -283,11 +283,10 @@ def __get__(self, obj, cls):
283
283
if self .element_count == 1 :
284
284
unpacked = unpacked [0 ]
285
285
if self .field_names and len (self .field_names ) == len (unpacked ):
286
- # If we have field names, use them to make a namedtuple, and we should already have that defined.
286
+ # If we have field names, we should already have a namedtuple type to use
287
287
# Unless the element count is off, which... werid.
288
- return self .MDFTuple (* unpacked )
289
- else :
290
- return unpacked
288
+ return self .mdf_tuple (* unpacked )
289
+ return unpacked
291
290
if len (packed ) % self ._entry_length != 0 :
292
291
raise RuntimeError ("Invalid data length" )
293
292
entry_count = len (packed ) // self ._entry_length
0 commit comments