Skip to content

Commit

Permalink
Or do we need simply something along these lines?
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kirienko committed Aug 12, 2023
1 parent e6b7c25 commit 65b4532
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nunavut/lang/py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class Language(BaseLanguage):

PYTHON_RESERVED_IDENTIFIERS: list[str] = sorted(list(map(str, list(keyword.kwlist) + dir(builtins))))

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self._language_options["enable_serialization_asserts"] = True

@functools.lru_cache(maxsize=None)
def _get_token_encoder(self) -> TokenEncoder:
"""
Expand Down
3 changes: 3 additions & 0 deletions src/nunavut/lang/py/templates/base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# pylint: skip-file
# mypy: warn_unused_ignores=False

{% assert options.enable_serialization_asserts -%}
{#- These templates always generate serialization asserts. -#}

{% set ARRAY_PRINT_SUMMARIZATION_THRESHOLD = 100 -%}
{#- How many elements in the array trigger summarization rather than full output.
#- Summarization replaces middle elements with an ellipsis. -#}
Expand Down

0 comments on commit 65b4532

Please sign in to comment.