Skip to main content

ambiguous

flexibility when you need it

Install

pip install ambiguous

Usage

decorator: allow decorators to accept arguments

from ambiguous import decorator


@decorator
def power(fn, exponent=2):
  '''take function results and raise to an exponent'''
  return lambda x: fn(x) ** exponent


@power
def squared(x): return x

squared(2)
> 4


@power(exponent=3)
def cubed(x): return x

cubed(2)
> 8

thing_or_things: combine gets and multigets

from ambiguous import thing_or_things

@thing_or_things
def itself(args):
  return { x : x for x in args }

itself(1)
> 1
itself([1, 2])
> { 1 : 1, 2 : 2 }


# specify which argument
@thing_or_things('args')
def prefix(prefix, args):
  return { x : "%s_%s" % (prefix, x) for x in args }

prefix('abc', [1, 2])
> { 1 : 'abc_1', 2 : 'abc_2' }

optional parentheses (warning: still experimental)

import ambiguous

@ambiguous
def foo():
  return 'foo'

# the usual
foo()
> 'foo'

# ?!?
foo
> 'foo'
foo + 'abc'
> 'fooabc'

installs

Metadata

Release files for ambiguous 0.5.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 ambiguous 0.5.1
File Size Uploaded Provenance
ambiguous-0.5.1.tar.gz 11.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 17.7 kB

Release files / ambiguous-0.5.1.tar.gz

Download URL ambiguous-0.5.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8ecd2957458fcfc7be224cfdd59795033b23c8c6a2a6e79f8059feb093f23034
BLAKE2b-256 checksum
How to use checksums
4184aa41d8cb65644eacb88e6eb289e6aefd59cf861b6b26b859a5da89080270
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 13, 2026.

Transparency log

Release files / ambiguous-0.5.1-py3-none-any.whl

Download URL ambiguous-0.5.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db38d0981afce5adda1a7eb2c944d5a03eae3090c72c845a395e78f4e53002be
BLAKE2b-256 checksum
How to use checksums
650e89027d71b45a0d0fa60836e77d047ee2324c85cf1593cdca152bc0f60062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 13, 2026.

Transparency log

Security for ambiguous 0.5.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ambiguous-0.5.1.tar.gz

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 Jun 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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