Skip to main content

image image image image build image CodeQL CodSpeed Badge image ty

A placeholder uses operator overloading to create partially bound functions on-the-fly. When used in a binary expression, it will return a callable object with the other argument bound. It's useful for replacing lambda in functional programming.

Usage

from placeholder import _     # single underscore

_.age < 18     # lambda obj: obj.age < 18
_[key] ** 2    # lambda obj: obj[key] ** 2

Note _ has special meaning in other contexts, such as the previous output in interactive shells. Assign to a different name as needed.

_ is a singleton of an F class, and F expressions can also be used with functions.

from placeholder import F

-F(len)        # lambda obj: -len(obj)

All applicable double underscore methods are supported. Some methods coerce types: len, bool, in.

Performance

The placeholder instance leverages functools.partial and Placeholder for optimization. It is significantly faster than similar libraries on PyPI.

Performance should generally be comparable to inlined expressions, and faster than lambda. There is an optional legacy C extension which provides a small speedup for right-bound functions in Python <3.14 only.

Placeholders are provisionally iterable, allowing access to the underlying function and bound args.

(func,) = _.age  # operator.attrgetter('age')

Installation

pip install placeholder

Tests

100% branch coverage.

pytest [--cov]

Release files for placeholder 1.6

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

Source distribution (sdist)

Source distribution for placeholder 1.6
File Size Uploaded
placeholder-1.6.tar.gz 6.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for placeholder 1.6
File
placeholder-1.6-py3-none-any.whl Python 3 none any Details
placeholder-1.6-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
placeholder-1.6-cp311-abi3-win32.whl CPython 3.11 abi3 Windows x86-32 Details
placeholder-1.6-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
placeholder-1.6-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details
placeholder-1.6-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details
placeholder-1.6-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl CPython 3.11 abi3 Linux glibc 2.5+ x86-64, Linux glibc 2.28+ x86-64 Details
placeholder-1.6-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
placeholder-1.6-cp311-abi3-macosx_10_9_x86_64.whl CPython 3.11 abi3 macOS 10.9+ x86-64 Details

Total release size: 91.0 kB

Release files / placeholder-1.6.tar.gz

Download URL placeholder-1.6.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6a5d5c25634ec36e0e336ff8ce98675f66176518ae7ee92755c198747dd48bd2
BLAKE2b-256 checksum
How to use checksums
ed37e37e0e5dd77438df4799254c226fc2bec113ee38269bf29efb1fb91e8638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-py3-none-any.whl

Download URL placeholder-1.6-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1fde902a2ebb02f65c7156e07ff41bb02aee9f7d98482d242963c3514c39298
BLAKE2b-256 checksum
How to use checksums
ab5eb31edfd4efa216bf316ef6d69d6d4ceef5ce3d1372a51df87db2aa9c6a57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-win_amd64.whl

Download URL placeholder-1.6-cp311-abi3-win_amd64.whl
Size 10.1 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
076c9985f3a37e57a7db232b4f33768f73f7f7bbdce915ed51bb0b813aea2dbf
BLAKE2b-256 checksum
How to use checksums
a6e0fa9db2de905130edbba78b969bc8667e7c5a971922df56cd2c738439e346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-win32.whl

Download URL placeholder-1.6-cp311-abi3-win32.whl
Size 9.9 kB
Tags CPython 3.11 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
900a89a154110661fca12df0ecfd2b0efdfa47617381b174826b7cc64b1b7360
BLAKE2b-256 checksum
How to use checksums
57851b0d6ad4627f2401663ceb9fb3b8fa1e178bdf9a5c5cee7443a71c6daf22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL placeholder-1.6-cp311-abi3-musllinux_1_2_x86_64.whl
Size 10.8 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
c93d3194ae83d2eb870b0cbf646a32c2f62734a78ae173cf4c624fcad6fc0bc3
BLAKE2b-256 checksum
How to use checksums
67eef24dd6f26dfe7f8c9314dfd871445f850ade79d42504b98c22122d8c461b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL placeholder-1.6-cp311-abi3-musllinux_1_2_aarch64.whl
Size 11.4 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
f4634694c8ebde89fb53a99d2734755b90eb683b32aa41a1112166726d45bbf2
BLAKE2b-256 checksum
How to use checksums
7e359bdb2a2fc101f07a1ec9e8057d21f6f171b7df024023684280ffb55f1093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL placeholder-1.6-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 11.5 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
204adeeedb887c02006dde74e8548a8d19f69b56cb469c9c22847f8509966f0e
BLAKE2b-256 checksum
How to use checksums
23e9111fcf979400bf0c3498a23e8e074192f255ee7be35679400655e5a6af61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl

Download URL placeholder-1.6-cp311-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Size 10.5 kB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
55a11a3fa9776138ed962b5636af00ed989c2525c3f1b7d2d1a312a81c255b25
BLAKE2b-256 checksum
How to use checksums
382e9bf7efb644772cbf1b94f575f1311b96d89f8325cdc233d4859b7253f060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-macosx_11_0_arm64.whl

Download URL placeholder-1.6-cp311-abi3-macosx_11_0_arm64.whl
Size 7.8 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3cefc7fe0ccef3d9af1a3fc953be2ed2215d719847570da65c6c89de09c001cf
BLAKE2b-256 checksum
How to use checksums
9c79ee3aa2b06bba613daffd7bc9147fa15b13c6274761670fd0bcc30c966fd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / placeholder-1.6-cp311-abi3-macosx_10_9_x86_64.whl

Download URL placeholder-1.6-cp311-abi3-macosx_10_9_x86_64.whl
Size 7.4 kB
Tags CPython 3.11 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f00ba7a2cd71d0bfaee647fe879d531b079a279d38752618d17b72aff8cf28a0
BLAKE2b-256 checksum
How to use checksums
c23a16675bd1a178a4878132a6abececeb28562a30fa0cbbbd85690bce79988a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.6 This release

10 release files

1.5.1

9 release files

1.5

11 release files

1.4

8 release files

1.3

13 release files

1.2.1

17 release files

1.2

6 release files

1.1

2 release files

1.0

2 release files

0.7.1

2 release files

0.7

2 release files

0.6

2 release files

0.5

1 release file

0.4.1

1 release file

0.4

1 release file

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