Metadata-Version: 2.5
Name: compat-sentinel
Version: 0.1.1
Summary: PEP 661 sentinel for Python versions before 3.15
Project-URL: Repository, https://github.com/owebeeone/compat-sentinel
Project-URL: Issues, https://github.com/owebeeone/compat-sentinel/issues
Project-URL: Source, https://github.com/owebeeone/compat-sentinel
Author: compat-sentinel contributors
License: MIT License
        
        Copyright (c) 2026 Gianni Mariani
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: compatibility,pep661,pickle,sentinel
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == 'test'
Description-Content-Type: text/markdown

# compat-sentinel

PEP 661 `sentinel` for Python 3.10 and later.

On Python 3.15 and later, `compat_sentinel.sentinel` is the builtin. On older
interpreters it is a local implementation with the same constructor, copy
behavior, and pickle lookup.

```python
from compat_sentinel import sentinel

MISSING = sentinel("MISSING")
DEFAULT = sentinel("DEFAULT", repr="<default>")
```

Each call returns a new object. A sentinel pickles back to itself when it can
be imported from its module under `__name__`:

```python
MISSING = sentinel("MISSING")

class Box:
    SHORT = sentinel("Box.SHORT")
```

A sentinel created in a local scope and never stored under that name does not
pickle. `__module__` is taken from the caller and is writable; pickle uses the
value present at dump time.

`int | MISSING` and `MISSING | str` build a `typing.Union`.
