--- /dev/null +++ b/sample/_constants.py @@ -0,0 +1,2 @@ +LIMIT = 1800 # API contract +LABEL = "café" --- a/sample/a.py +++ b/sample/a.py @@ -1,7 +1,6 @@ from __future__ import annotations -LIMIT = 1800 # API contract -LABEL = "café" +from ._constants import LABEL as LABEL, LIMIT as LIMIT def compute(value: int) -> tuple[int, str]: from sample.b import limited --- a/sample/b.py +++ b/sample/b.py @@ -1,4 +1,4 @@ -from .a import LIMIT as UPPER, LABEL +from ._constants import LIMIT as UPPER, LABEL as LABEL def limited(value): return min(value, UPPER), LABEL