Skip to main content

Qblox-deprecation

Useful decorators to mark functions, classes, parameters, etc, as deprecated.

Examples

from qblox_deprecation.deprecate import (
    deprecate_positional_args_from,
    deprecated,
    deprecated_arg_alias,
)


def new_function(foo):
    return foo + foo


# Emit a future warning and call new_function instead
@deprecated("1.0", new_function)
def deprecated_function():
    return foo * foo


# Emit a future warning, extended with the message, and call the original function.
@deprecated("1.0", "Please use new_function instead.")
def deprecated_function():
    return 2


class NewClass:
    def __init__(self) -> None:
        pass


# Emit a future warning and construct an instance of NewClass instead
@deprecated("1.0", NewClass)
class OldClass:
    def __init__(self) -> None:
        pass


# Emit a future warning, extended with the message, and use the original class.
@deprecated("1.0", "Please use NewClass instead.")
class OldClass:
    def __init__(self) -> None:
        self.foo = "foo"


# Emit a future warning, and replace any usage of 'quux' with 'baz'.
@deprecated_arg_alias("1.3", quux="baz")
def foo(bar, baz, qux):
    pass


# Emit a future warning if any argument after 'b' is specified as a positional argument.
# This prepares for a refactor to `my_func(a, b, *, c, d)`
@deprecate_positional_args_from("c")
def my_func(a, b, c, d):
    pass


# You can use it on classes too!
@deprecate_positional_args_from("c")
class MyClass:
    def __init__(self, a, b, c, d):
        pass

Metadata

Release files for qblox-deprecation 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 qblox-deprecation 0.1.1
File Size Uploaded Provenance Actions
qblox_deprecation-0.1.1.tar.gz 86.3 kB Without provenance Details for qblox_deprecation-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qblox-deprecation 0.1.1
File Interpreter ABI Platform Actions
qblox_deprecation-0.1.1-py3-none-any.whl Python 3 none any Details for qblox_deprecation-0.1.1-py3-none-any.whl

Total release size: 91.6 kB

Release files / qblox_deprecation-0.1.1.tar.gz

Download URL qblox_deprecation-0.1.1.tar.gz
Size 86.3 kB
Tags Source
SHA-256 checksum
How to use checksums
03f008a7b81330108cec3b86cc68199ddfd0dd2af9daacf7772ab8c5d4cc87f0
BLAKE2b-256 checksum
How to use checksums
26ec6b880b71793c8fcd4b3a1e9047296a949dc7a41076dea5fec6420f16e6dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

Download URL qblox_deprecation-0.1.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6b53f907891b2abbc77cd65a6298371aaaf65ac2ff522a2cbc42bf5d5098b6e
BLAKE2b-256 checksum
How to use checksums
b30923b2643d301b9b806532b8e7a37998d9a1f4ddb657bfbf860d374482e68f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for qblox-deprecation 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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