strict
Python strict tag
pip install pystrict
Using @strict on classes can prevent serious errors by raising an exception when an instance has a variable created outside of init. Unfortunately, linters don't (cannot) always catch this. I can't express how much time this has saved me recently.
Using @strict on functions only checks type specifiers.
Example:
from pystrict import strict
# not allowed, missing type specifier
@strict
def foo(x: int, y):
...
# not allowed, missing type specifier in __init__
@strict
class Foo():
def __init__(self, x: int, y):
...
# not allowed, object modified outside of init
@strict
class Foo():
def __init__(self, x: int):
self.x = 1
# mypy and pytest won't check this
def evil():
return list({'a':Foo(1)}.values())
z = evil()
z[0].y = 4
Metadata
Release files for pystrict 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pystrict-1.3.tar.gz | 9.5 kB | Without provenance | Details for pystrict-1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pystrict-1.3-py3-none-any.whl | Python 3 | none | any | Details for pystrict-1.3-py3-none-any.whl |
Total release size: 12.6 kB
Release files / pystrict-1.3.tar.gz
| Download URL | pystrict-1.3.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09d1c236850667510684e259416445309ae68bbf7ac99570efa80fcef750481a
|
|
BLAKE2b-256 checksum How to use checksums |
1430405f438e8438192bd25660d1869b08af22faa260a8aeadab37be6c1e7d45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.26.0
|
Release files / pystrict-1.3-py3-none-any.whl
| Download URL | pystrict-1.3-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
548c6fb417753f15933f628633fc808f01795ca8048623aae064f5c7eaa0ac42
|
|
BLAKE2b-256 checksum How to use checksums |
9fc609a4294888d43cbe76e115cd0992fe9f84298c76b146e7864e0ff002b20c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.26.0
|
Security for pystrict 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.