Skip to content

Commit 5ac9214

Browse files
committed
Add some more comments to validate_symbol_tables()
1 parent 2716916 commit 5ac9214

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

basest/core/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ def validate_symbol_tables(symbol_table, padding_symbol, other_symbol_table):
4242
Raises ValueError if either of the symbol tables (or padding symbol) fail
4343
validation.
4444
"""
45+
# first check that they all do not contain None
4546
if None in (symbol_table + [padding_symbol] + other_symbol_table):
4647
raise ValueError(
4748
'None cannot be used in symbol tables nor for padding'
4849
)
50+
# if that check passes, validate tables (and padding) for uniqueness
51+
# the padding symbol is evaluated with the first symbol table
4952
elif (
5053
(not symbol_table_is_unique(symbol_table, padding_symbol)) or
5154
(not symbol_table_is_unique(other_symbol_table))

0 commit comments

Comments
 (0)