Skip to main content

PolyConf

Credit

The polyconf.core.deepmerge module is a heavy refactor of gh://toumorokoshi/deepmerge. (More specifically, I based it on the tip of main at the time, which was commit 33a078ac7a29b63dfb91fea806cc6b96ede3fd23.) I don't want this library to have 3rd party dependencies, so I basically stripped the dynamic configurability of deepmerge, such that the behavior of always_merge() became the only behavior.

The keyword arguments are quite self-explanatory, so to concisely define the behavior, consider this snippet:

always_merger = Merger(
    type_strategies=[
        (list, "append"),
        (dict, "merge"),
        (set, "union"),
    ],
    fallback_strategies=["override"],
    type_conflict_strategies=["override"],
)

The refactor is heavy, indeed. At the time of this writing, cloc calculates it at only 22 lines of code. However, I still want to give credit where it's due because there are a couple lessons in recursion and fallback behavior that would have been painful to work out myself. It also serves as a reminder for future reference because if I ever reverse the moratorium on 3rd party libs, I'll happily depend on deepmerge directly.

Release files for polyconf 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polyconf 0.2.0
File Size Uploaded
polyconf-0.2.0.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for polyconf 0.2.0
File Interpreter ABI Platform
polyconf-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.5 kB

Release files / polyconf-0.2.0.tar.gz

Download URL polyconf-0.2.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bd640a8b43befd7e8673df412150ff0559224ff184b4cc171ce2f8628d5a52af
BLAKE2b-256 checksum
How to use checksums
dc544debc403da0579ca600f6466a2a4bd21dd919d669591589c40e7d9b9cb19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.0 Linux/6.4.6-zen1-1-zen

Release files / polyconf-0.2.0-py3-none-any.whl

Download URL polyconf-0.2.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f9f9c471790620b18a824b9189f717e7f8014b8b25f399a3e46e63bcc0eee22
BLAKE2b-256 checksum
How to use checksums
ef4436ef019e3ced66379f7e973dffcb5e97002137bc50fabd4d9b2da53db9af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.0 Linux/6.4.6-zen1-1-zen

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page