1"""
2_constants
3======
4
5Constants relevant for the Python implementation.
6"""
7
8from __future__ import annotations
9
10import platform
11import sys
12import sysconfig
13
14IS64 = sys.maxsize > 2**32
15
16PY312 = sys.version_info >= (3, 12)
17PY313 = sys.version_info >= (3, 13)
18PY314 = sys.version_info >= (3, 14)
19PY315 = sys.version_info >= (3, 15)
20PYPY = platform.python_implementation() == "PyPy"
21WASM = (sys.platform == "emscripten") or (platform.machine() in ["wasm32", "wasm64"])
22ISMUSL = "musl" in (sysconfig.get_config_var("HOST_GNU_TYPE") or "")
23# the refcount for self in a chained __setitem__/.(i)loc indexing/method call
24REF_COUNT = 2 if PY314 else 3
25REF_COUNT_IDX = 2
26REF_COUNT_METHOD = 1 if PY314 else 2
27CHAINED_WARNING_DISABLED = PYPY
28
29
30__all__ = [
31 "IS64",
32 "ISMUSL",
33 "PY312",
34 "PY313",
35 "PY314",
36 "PY315",
37 "PYPY",
38 "WASM",
39]