Metadata-Version: 2.4
Name: cs-semantics
Version: 20261016
Summary: Some basic functions and exceptions for various semantics shared by modules.
Keywords: python3
Author-email: Cameron Simpson <cs@cskk.id.au>
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Requires-Dist: cs.deco>=20261016
Project-URL: MonoRepo Commits, https://bitbucket.org/cameron_simpson/css/commits/branch/main
Project-URL: Monorepo Git Mirror, https://github.com/cameron-simpson/css
Project-URL: Monorepo Hg/Mercurial Mirror, https://hg.sr.ht/~cameron-simpson/css
Project-URL: Source, https://github.com/cameron-simpson/css/blob/main/lib/python/cs/semantics.py

Some basic functions and exceptions for various semantics shared by modules.



Short summary:


* `ClosedError`: Exception for operations which are invalid when something is closed.


* `not_closed`: A decorator to wrap methods of objects with a `.closed` property which should raise when `self.closed`. This raised `ClosedError` if the object is closed.

# Functions

## not_closed(*da, **dkw)

A decorator to wrap methods of objects with a `.closed` property
which should raise when `self.closed`.
This raised `ClosedError` if the object is closed.

Excample:

    @not_closed
    def doit(self):
        ... proceed know we were not closed ...

# Classes

## class ClosedError(builtins.Exception)

Exception for operations which are invalid when something is closed.
