Skip to main content

argparse-oappend

Provides oappend action for argparse that works almost like append, but skips the default list if the user gives any value for the option.

See issue 16399 for a discussion.

Example

You may import OverrideAppendAction and register it with a parser or use the provided parser:

from oappend import OverrideAppendArgumentParser

parser = OverrideAppendArgumentParser()
parser.add_argument('-n', action='oappend', type=int, default=[1, 2])
args = parser.parse_args(['-n3', '-n4'])  # Namespace(n=[3, 4])

With the standard append action the option would be set to [1, 2, 3, 4], combining your default with user choices.

Installation

pip3 install argparse-oappend

Metadata

Release files for argparse-oappend 0.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 argparse-oappend 0.0.1
File Size Uploaded
argparse-oappend-0.0.1.tar.gz 2.1 kB Details

Release files / argparse-oappend-0.0.1.tar.gz

Download URL argparse-oappend-0.0.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f64234d0a06b01734dba63b67467796f3e71c93bee672c8318b7655ddf4291b8
BLAKE2b-256 checksum
How to use checksums
f5b1df42691bd68579c50f64fbbfc9c3cb529abe0bae84e25524ef227f40fb04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.1 This release

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