Mo python, less problems. Helpful python utilities.
Project description
pymore
pymore is a collection of useful utilities for Python.
This includes
- EqualsTester: a helper for testing the equality contract in Python (originally developed for Cirq)
import pymore
tester = pymore.EqualsTester()
# This tests that the added elements all satisfy the equals contract
# between themselves.
tester.add_equality_group(MyObject("a"), MyObject("a"))
# Each new addition of an equality group also tests that the elements
# in this new group are not equal to those in the previously added group.
# So, for example, this would raise an `AssertionError` if it was
# true that `MyObject("a")` was equal to `MyObject("b")`.
tester.add_equality_group(MyObject("b"), MyObject("b"))
- first: Return the first element that matches a predicate, or a default.
import pymore
is_even = lambda x: x % 2 == 0
# Returns the first element that is even.
first = pymore.first([1, 3, 6, 7], is_even)
assert first == 6
License
This package is licensed under an Apache 2.0 license. This code is derived from work in other frameworks. See LICENSE and NOTICES for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymore-0.1.5.tar.gz
(12.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pymore-0.1.5-py3-none-any.whl
(13.2 kB
view details)
File details
Details for the file pymore-0.1.5.tar.gz.
File metadata
- Download URL: pymore-0.1.5.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39b99376c62f2ca02f5f6600d69f0f3d3f2103101514ef711fccfabcdb64a1a5
|
|
| MD5 |
333435846ed0249b2100b2f5d240a95c
|
|
| BLAKE2b-256 |
de7f228d379452ff94ce3ecc1880e595008e633387d4e9847c07c6ebe8dd145a
|
File details
Details for the file pymore-0.1.5-py3-none-any.whl.
File metadata
- Download URL: pymore-0.1.5-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81d492d4d8af14c7df9974a620e09a40861d30541039dd0fcb3ee6805a88b0ab
|
|
| MD5 |
7426bf415f9370ac19b922b6d605cc3b
|
|
| BLAKE2b-256 |
a9a30e88676a834d2d145f237f34048104a2ae3a1f32fbecb55122524a282abb
|