Skip to main content

bagof-factories

Hint-based factories that build default values at runtime.

Example

>>> from bagof.factories import get_factory
>>> get_factory(list[int])()
[]
>>> get_factory(dict[str, int])()
{}
>>> get_factory(set[int])()
set()
>>> get_factory(int)()
0
>>> get_factory(int | None)()  # optional -> None
>>> get_factory(str)()
''

Abstract collection ABCs (Sequence, Mapping, Set, Iterable, ...), numeric ABCs (numbers.Integral, numbers.Real, ...), enumerations, and builtin/stdlib types whose constructor needs arguments (range, slice, memoryview, datetime, date, uuid.UUID) are all handled too.

Metadata

Release files for bagof-factories 0.1.1

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

Source distribution (sdist)

Source distribution for bagof-factories 0.1.1
File Size Uploaded
bagof_factories-0.1.1.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bagof-factories 0.1.1
File Interpreter ABI Platform
bagof_factories-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 40.4 kB

Release files / bagof_factories-0.1.1.tar.gz

Download URL bagof_factories-0.1.1.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
34e0360c03002c382ab2b9bb8a5d3063ee1d5a8602b994c3109bb9614051775a
BLAKE2b-256 checksum
How to use checksums
94ee42aaa74eda1f718bfdfdb8246bdf270f7a6127aa09fa45a26b4cd1d43aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / bagof_factories-0.1.1-py3-none-any.whl

Download URL bagof_factories-0.1.1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9dc57e369a4339047c4a3528b690163fafa85bfae3cdf5cc70f43cdffce34f8a
BLAKE2b-256 checksum
How to use checksums
328160e2b8412900ede12eded9fab241c114880fa174da4ad8e6d491570749cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

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