Skip to main content

Yuck!

Yuck! is a library that is helpful when you need to create a singleton instance of a function.

Just decorate the function you want to singletonize, call it once with setup arguments and subsequent calls will use the already setup function call.

Example

from yuck import yuck


@yuck
def db(connection_string: str):
    connection = connect(connection_string)

    query = yield
    while True:
        query = yield connection.execute(query)


# Initial setup
db_instance = db("sqlite:///:memory:")

# Use the singleton instance
result = db_instance.send("SELECT * FROM users")
print(result)

NOTE: I'm not entirely sure this really works but I'm too lazy to even check :D.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyuck-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyuck-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file pyuck-0.1.0.tar.gz.

File metadata

  • Download URL: pyuck-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pyuck-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9501d54946b544ffb1152429f6622ba4063dd5fe5a0424a39f48b094aaac11c0
MD5 1e6dc9e28e462c54090991092b4eeff9
BLAKE2b-256 7b234b2078e0544606dd50778acb6e73d238a40362a28e291426586a7d7894bb

See more details on using hashes here.

File details

Details for the file pyuck-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyuck-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pyuck-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46f4cabd97e09bdf0a19464ef8fdd8249a67819cc8922e25063fe48ae632a751
MD5 a293058aee6236fba12cb99c6fcebbb7
BLAKE2b-256 2ac431ff4cb574005ccfcf2114df82de992a705644771145d3ae677b199d2b39

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page