Recordclass

Latest version: v0.22.1

Safety actively analyzes 688803 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.22.1

Starting this release recordclass has `pyproject.toml` and support of `pytest` with editable install.

* Add `pyproject.toml`.
* Add `pytest.ini` in order to run `pytest`:

>>> pip3 install -e .
>>> pytest

0.22.0.3

Changes:

* Rename examples\test_*.py files since they are detected by pytest as a tests.
* Fix segfault with litelist after 0.22.0.2.

0.22.0.2

* Make releases on PyPI and gihub with identical content and the right tag.

0.22.0.1

* Fix regression with `as_dataclass`.

0.22

Recordclass 0.22` started support of `python 3.13`.

Changlog:

* Add a base class `datastruct` for subclasses that should behave more like simple datastructures.
* Fix bug with `__match_args__` (6).

0.21.1

**What's new**

1. Allow to specify __match_args__. For example,


class User(dataobject):
first_name: str
last_name: str
age: int
__match_args__ = 'first_name', 'last_name'

or

`User = make_dataclass("User", "first_name last_name * age")`

2. Add as_record adapter for def-style decalarations of dataclasses that are considered as just a struct. For example:


as_record()
def Point(x:float, y:float, meta=None): pass

>>> p = Point(1,2)
>>> print(p)
Point(x=1, y=2, meta=None)

It's almost equivalent to:

` Point = make_dataclass('Point', [('x':float), ('y',float),'meta'], (None,))`

3. The option fast_new will be removed in 0.22. It will be always as fast_new=True by creation.


class Point(dataobject):
x:int
y:int

def __new__(cls, x=0, y=0):
return dataobject.__new__(cls, x, y)

4. Fix issues with `_PyUnicodeWriter` for python 3.13.

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.