From: Henryk Plötz Date: Thu, 9 Aug 2018 22:07:07 +0000 (+0200) Subject: flat_length_max is not used anymore X-Git-Tag: v2.0.0~1^2~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70ea3725020ac9206348569f9c44eef6bb58906a;p=thirdparty%2Fpython-fints.git flat_length_max is not used anymore --- diff --git a/fints/formals.py b/fints/formals.py index 4e38232..ad78d6e 100644 --- a/fints/formals.py +++ b/fints/formals.py @@ -163,7 +163,6 @@ class Field: class TypedField(Field, SubclassesMixin): flat_length = 1 - flat_length_max = 1 def __new__(cls, *args, **kwargs): target_cls = None @@ -216,19 +215,6 @@ class ContainerField(TypedField): raise TypeError("Cannot compute flat length of field {}.{} with variable count".format(self.__class__.__name__, name)) result = result + field.count * field.flat_length return result - - @property - def flat_length_max(self): - result = 0 - for name, field in self.type._fields.items(): - # Note: We're *not* recursing into flat_length_max, because we don't want variable count fields at deeper levels - if field.count is not None: - result = result + field.count * field.flat_length - elif field.max_count is not None: - result = result + field.max_count * field.flat_length - else: - raise TypeError("Cannot compute max flat length of field {}.{} without count and max_count".format(self.__class__.__name__, name)) - return result class DataElementGroupField(ContainerField):