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

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
File Size Uploaded
bagof_factories-0.1.tar.gz 23.0 kB Details

Built distribution (wheel)

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

Total release size: 39.9 kB

Release files / bagof_factories-0.1.tar.gz

Download URL bagof_factories-0.1.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2f9684183ba07ef83d10d9470e613cd3850ccea0e72456ecb248a654c7146742
BLAKE2b-256 checksum
How to use checksums
fdbf0199840f6f448b360de1ba4ecc7bdbd7b676209e61f0481f7be55ad9d03b
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-py3-none-any.whl

Download URL bagof_factories-0.1-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f912db0f57df8ea04a88137c8bc361b6b0330ce905f95826c3c30ca10375e340
BLAKE2b-256 checksum
How to use checksums
3ec21b23f16f58362e74c6399b3ce3b5b8e1e2053c13df413769dfa267e05b6f
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

0.1.1

2 release files

This release

0.1 This release

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