Compatibility
Python versions
conditional-method supports CPython 3.9 through 3.14. Because the extension is
built against the Limited API / stable ABI (abi3), a single cp39-abi3
wheel covers every CPython 3.9+ release — no per-version wheels are needed.
| Feature | 3.9 | 3.10 | 3.11 | 3.12 | 3.13 | 3.14 |
|---|---|---|---|---|---|---|
@cfg / @cfg_attr |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| abi3 wheel | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Full test suite | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Known interpreter differences
Two CPython behaviors changed across the supported range; the test suite
handles both (tests/_compat.py):
-
__set_name__error wrapping — CPython < 3.12 wraps aTypeErrorraised by__set_name__inRuntimeError: Error calling __set_name__ on ...; 3.12+ propagates theTypeErrordirectly (with the wrapper text attached as a note). Your code is unaffected either way — a false@cfgmethod makes class creation fail — but if you catch these errors, match on both. -
Missing context-manager protocol — using an object without
__enter__/__exit__as a context manager raisesAttributeErroron < 3.11 andTypeError(does not support the context manager protocol) on 3.11+.
Platforms
Wheels are published for:
- Linux (manylinux2_28 / musllinux): x86_64, aarch64, i686, ppc64le, s390x, armv7l
- macOS: arm64, x86_64
- Windows: AMD64, ARM64, x86
Dependencies
conditional-method has zero runtime dependencies.