Plaintools

Latest version: v1.3.241103.1

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

Scan your dependencies

Page 1 of 3

1.3.241103.1

- Fixed `Test` name property not reseting on context exit or end of call

1.3.241103

|![Image](https://raw.githubusercontent.com/gabrielmsilva00/PlainTools/refs/heads/main/imgs/pthead.png)
|:-:|
<a href=https://pypi.org/project/PlainTools><img src="https://img.shields.io/pypi/v/plaintools.svg?logo=pypi" alt="Version" width=256 style="vertical-align:middle;margin:5px"><br/><a href=https://github.com/gabrielmsilva00/PlainTools><img src="https://img.shields.io/badge/GitHub-Repository-2A3746?logo=github" width=256 style="vertical-align:middle;margin:5px"><br/><a href=https://github.com/gabrielmsilva00/PlainTools/releases><img src="https://img.shields.io/pypi/dm/plaintools?logo=pypi" alt="Version" width=256 style="vertical-align:middle;margin:5px">
[<img src=https://raw.githubusercontent.com/gabrielmsilva00/PlainTools/refs/heads/main/imgs/ptqrdoc.png?>](https://gabrielmsilva00.github.io/PlainTools)<br/>[![pages-build-deployment](https://github.com/gabrielmsilva00/PlainTools/actions/workflows/pages/pages-build-deployment/badge.svg?branch=main)](https://github.com/gabrielmsilva00/PlainTools/actions/workflows/pages/pages-build-deployment)

Installation

This package can be installed & upgraded using `pip`:

sh
pip install -U plaintools

1.3.241103.0

- New `Test` context manager and callable class to easily do assertion testing with easy to understand debug info. This was done mostly for internal use of the package (in the unit testing) and as such, is not well refined. Usage is as:
python
import PlainTools as pt

Example usage of the Test context
with pt.Test.name("pnumber") as t:
Also possible to do:
t.name("pnumber")
x = pt.pnumber(1 / 3)
t(
str(x) == '0.333...',
x.value == 0.333333333333333,
x.period == '3',
x.fraction == (1, 3),
x.type == float,
)
Output: |Test 4(pnumber) = PASS

Example usage of the Test callable
def foo(x):
return x + 5

pt.Test(foo(10), 15)

Output: |Test 21 = PASS

1.3.241029

DEPRECATED

1.3.241029.0

- Revamped the inner works of the `pt.pnumber()` function, and added `pt.Numeric` class and `pt.NumericType` metaclass to the main scope of the package. These classes are not intended to be used directly, instead it is recommended to use the `pt.pnumber()` function. This change gave a speed-up of 1000x or more to the function and all other functions using the numeric constructor!
- Removed the `pt.pround()` function as it was superseeded by the (now faster!) `pt.pnumber()` constructor.
- Small bugfixes and improvements.

1.3

**This is the v1.3 Release!**

This is as of now the final release candidate of this package.

Future work will focus on maintance and bugfixes.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.