Coverage for zanj / consts.py: 71%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-02-22 19:31 -0700

1"""Constants and re-exports from muutils with version compatibility.""" 

2 

3from __future__ import annotations 

4 

5# Items that exist in muutils.json_serialize.util across all versions 

6from muutils.json_serialize.util import ( 

7 JSONdict, 

8 JSONitem, 

9 MonoTuple, 

10 safe_getsource, 

11 string_as_lines, 

12) 

13 

14# _FORMAT_KEY and _REF_KEY moved from .util to .types in muutils >= 0.9 

15try: 

16 from muutils.json_serialize.types import _FORMAT_KEY, _REF_KEY # type: ignore[import-not-found] 

17except ImportError: 

18 # fallback for muutils < 0.9 where these lived in .util; mypy can't resolve this across try/except 

19 from muutils.json_serialize.util import _FORMAT_KEY, _REF_KEY # type: ignore[import-not-found, attr-defined, no-redef] 

20 

21__all__ = [ 

22 "JSONdict", 

23 "JSONitem", 

24 "MonoTuple", 

25 "_FORMAT_KEY", 

26 "_REF_KEY", 

27 "safe_getsource", 

28 "string_as_lines", 

29]