Skip to content

Commit

Permalink
Allow using heterogeneous arrays (#434)
Browse files Browse the repository at this point in the history
This is valid since TOML 1.0
  • Loading branch information
arp242 authored Oct 11, 2023
1 parent f6e1e4c commit 6d51c0a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions toml/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6d51c0a

Please sign in to comment.