semvec/pypi-packages huggingface dataset:
lsdelta 0.9.1
Least Significant Digit Delta
Requires Python: >=3.10

LSDelta - Least Significant Digit Delta
=======================================

`lsdelta` is a simple little library that provides a single function:

**`lsdelta(a :str|bytes, b :str|bytes) -> int`**

This function takes two decimal numbers stored as strings,
pads them both to the same length after the decimal point,
and then removes the decimal point and subtracts them,
giving you the difference in their least significant digits.

    >>> from lsdelta import lsdelta
    >>> lsdelta("399.999","400")
    -1
    >>> lsdelta("1035.349", "1035.35")
    -1
    >>> lsdelta("1035.110", "1035.1")
    10

This exists because it's part of a check I sometimes need to do
on large datasets, which is why it's implemented in C for speed.


Author, Copyright, and License
------------------------------

Copyright (c) 2024 Hauke Daempfling (haukex@zero-g.net)
at the Leibniz Institute of Freshwater Ecology and Inland Fisheries (IGB),
Berlin, Germany, https://www.igb-berlin.de/

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see https://www.gnu.org/licenses/
reslot 0.10
Class decorator to enable @cached_property on classes with __slots__
Requires Python: ~=3.8

# reslot


A class decorator that lets you use `@cached_property` on classes with `__slots__`.

The decorated class needs a `__dict__` slot, but there won't exactly be a
dictionary in it. Instead, `@reslot` will give it a custom `MutableMapping`
with *its own* slots. `@cached_property` will keep its cache there.

The custom `MutableMapping`'s slots will be exactly the slots needed to store
the results of every `@cached_property` that was on the class at the time it
was declared. This minimizes the memory footprint and makes lookup speedy.


## Usage

```python
from functools import cached_property

from reslot import reslot

BEANED = False

@reslot
class Spam:
    __slots__ = ("__dict__",)

    @cached_property
    def eggs(self):
        return {"delicious": False}

    @cached_property
    def beans(self):
        global BEANED
        BEANED = True
        return {"spam": 111000, "delicious": True}

spam = Spam()
print(spam.eggs)   # {"delicious": False}
print(BEANED)      # False
print(spam.beans)  # {"spam": 111000, "delicious": True}
print(BEANED)      # True
```