From 6d51c0ac52d55da4d0509a4006648d66cacab454 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Wed, 11 Oct 2023 02:53:46 +0200 Subject: [PATCH] Allow using heterogeneous arrays (#434) This is valid since TOML 1.0 --- toml/decoder.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/toml/decoder.py b/toml/decoder.py index 6f23ec1..63869ad 100644 --- a/toml/decoder.py +++ b/toml/decoder.py @@ -942,7 +942,6 @@ def _load_array_isstrarray(self, a): return False def load_array(self, a): - atype = None retval = [] a = a.strip() if '[' not in a[1:-1] or "" != a[1:-1].split('[')[0].strip(): @@ -1024,11 +1023,6 @@ def load_array(self, a): a[i] = a[i].strip() if a[i] != '': nval, ntype = self.load_value(a[i]) - if atype: - if ntype != atype: - raise ValueError("Not a homogeneous array") - else: - atype = ntype retval.append(nval) return retval