darlog-py23
A tiny compatibility module for cross-Python2/3 code.
It's not a replacement for neither six nor __future__ modules but is more of an extension to them.
Defines the very basic stuff:
Python version booleans
PY2, PY3, PY310 - simple flags indicating whether you're running under Python 2, 3 or 3.10+.
Strings
str_types
A tuple containing all the string types - ready to be passed to isinstance():
- Python 2 -
(str, unicode) - Python 3 -
(str, )
unicode
Type alias:
- Python 2 -
unicode - Python 3 -
str
to_least_str()
Converts the given value to a string:
- Python 2: tries to turn to a
str,unicodeif fails. - Python 3: just an alias for
str().
str_format()
Formats a string and doesn't throw an error if any of the given arguments is unicode under Python 2. The resulting string is simply turned to unicode, too.
DataClasses
@attrs decorator
Tries to use attr.s and if it's not found, falls back to built-in decorator from Py3.10 and, finally to 3.7 implementation if available.
If none of those is found, applies the included dataclass implementation, the simplest possible one (@dataclass_fallback, see below) - as the last resort, just to avoid exceptions.
@dataclass decorator
Similar to @attrs, but tries built-in @dataclass first.
I'd recommend using @attrs anyway, but here it is.
Tries to use the built-in decorator from Py3.10, falls back to 3.7 implementation, then to attr.s. And, finally, to the included @dataclass_fallback.
@dataclass_fallback decorator
The minimal implementation of dataclass working in any Python version above 2.7. Implements only init, repr and eq features.
It doesn't do any "attribute is Field instance" stuff or any other getattr/setattr magic.
This is what both @dataclass and @attrs fall back to as the last resort. I don't know why would you need it explicitly, though - but here it is.
Metadata
Release files for darlog-py23 1.2.1
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 | |
|---|---|---|---|---|
| darlog-py23-1.2.1.tar.gz | 9.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| darlog_py23-1.2.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 19.9 kB
Release files / darlog-py23-1.2.1.tar.gz
| Download URL | darlog-py23-1.2.1.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da00c3080c886d37b4fb9b3fdea0a6b87fe3a50f4157b9321e08a8209359d87b
|
|
BLAKE2b-256 checksum How to use checksums |
26a5f5bc57070bce70362b38d450a108abc8e1d1b40159bff2ae3eacf5fc3035
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.9
|
Release files / darlog_py23-1.2.1-py2.py3-none-any.whl
| Download URL | darlog_py23-1.2.1-py2.py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b5d6306040c13c8865e2772909bd3b3d7cec28fb7788d525d1e9e59c6d277a22
|
|
BLAKE2b-256 checksum How to use checksums |
87e7805bf9c6b23084b1ce5a1ce2d764a2b75f1b68674b4224dc337a3515d24c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.9
|
Security for darlog-py23 1.2.1
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.