{"id":24983949,"url":"https://github.com/decorator-factory/py2-nostalgia","last_synced_at":"2026-02-28T18:02:15.433Z","repository":{"id":275548501,"uuid":"926410701","full_name":"decorator-factory/py2-nostalgia","owner":"decorator-factory","description":"Python2 style argument destructuring using parameter annotations","archived":false,"fork":false,"pushed_at":"2025-02-03T07:57:30.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-08T19:56:55.133Z","etag":null,"topics":["esoteric","python","python2","python3","shitpost"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decorator-factory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-03T07:49:29.000Z","updated_at":"2025-05-04T07:03:15.000Z","dependencies_parsed_at":"2025-02-03T08:36:12.265Z","dependency_job_id":"37fe083c-79d2-4b7c-911f-8bd7b760ccda","html_url":"https://github.com/decorator-factory/py2-nostalgia","commit_stats":null,"previous_names":["decorator-factory/py2-nostalgia"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/decorator-factory/py2-nostalgia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fpy2-nostalgia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fpy2-nostalgia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fpy2-nostalgia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fpy2-nostalgia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decorator-factory","download_url":"https://codeload.github.com/decorator-factory/py2-nostalgia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fpy2-nostalgia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29946463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T17:57:52.716Z","status":"ssl_error","status_checked_at":"2026-02-28T17:57:31.974Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esoteric","python","python2","python3","shitpost"],"created_at":"2025-02-04T09:40:56.494Z","updated_at":"2026-02-28T18:02:15.412Z","avatar_url":"https://github.com/decorator-factory.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `py2-nostalgia`\n\n(not to be confused with the PyPI project `nostalgia` which appears to do something useful)\n\nDo you ever miss the ability to unpack function arguments right in the signature? Like in the good old Python 2 days?\n\n```py\ndef print_point(label, (x, y)):\n    print \"({0},{1}); label={2})\".format(x, y, label)\n\nprint_point(\"origin\", (420, 69))\n```\n\nSay no more, as this package lets you do exactly that. With the power of PEP 3107 annotations!\n\n```py\nfrom nostalgia import nostalgia\n\n@nostalgia\ndef print_point(label: \"(\", x, y: \")\"):\n    print(f\"({x},{y}); label={label}\")\n\nprint_point(\"origin\", (420, 69))\n```\n\nOn top of that, you can destructure dictionaries:\n\n```py\nfrom nostalgia import nostalgia\n\n@nostalgia\ndef print_point(_: \"{\", label: \", {\", x, y, z: \":height }: point }\"):\n    print(f\"label:{label}, x:{x}, y:{y}, z:{z}\")\n\nprint_point({\"label\": \"origin\", \"point\": {\"x\": 420, \"y\": 6, \"height\": 9}})\n```\n\nIf the first parameter is named `_`, it is ignored. This lets you add something to the start of the\nunpacking signature, as you can see above.\n\nOf course, nobody is working with points or labels nowadays. Let's take a look at a more realistic example.\n\n# Leveraging the `@nostalgia` decorator for AI-powered workflows in the cloud\n\n```py\nfrom aiosky import the_cloud\n\n@nostalgia\nasync def sing_song(\n    _: \"{(\", topic1, topic2: \"):first_line, (\", topic3, topic4: \"):second_line, {\", vol: \":loudness\", device: \"}: config\", max_tokens: \"}\", api_token):\n    await the_cloud.leverage(\n        \"chatgpt \"\n        f\"--song {topic1},{topic2},{topic3},{topic4} \"\n        f\"--limit {max_tokens} {vol}@{device}\",\n        token=api_token\n    )\n\n# Call:\n\nprompt = {\n    \"first_line\": [\"love\", \"regret\"],\n    \"second_line\": [\"distance\", \"loss\"],\n    \"config\": {\n        \"loudness\": 11,\n        \"device\": \"obnoxious-bluetooth-speaker\",\n    },\n    \"max_tokens\": 5000,\n}\nawait sing_song(prompt, \"ABCDEF\")\n\n```\n\n# Keeping track of work-life balance and mental health while using the `py2-nostalgia` library\n\nIf you are not ready to go completely insane, you can use the `mild_reminiscence`\ndecorator factory instead of the `nostalgia` decorator.\n\n```py\nfrom nostalgia import mild_reminiscence\n\n@mild_reminiscence(\"label, (x, y)\")\ndef print_point1(label, x, y):\n    ...\n\n\n@mild_reminiscence(\"{label, {x, y, z:height}:point}\")\ndef print_point2(label, x, y, z):\n    ...\n\n\n@mild_reminiscence(\"\"\"\n  {\n    (topic1, topic2):first_line,\n    (topic3, topic4):second_line,\n    {vol:loudness, device}:config,\n    max_tokens\n  },\n  api_token\n\"\"\")\nasync def sing_song(topic1, topic2, topic3, topic4, vol, device, max_tokens, api_token):\n    ...\n\n```\n\n# Installation\n\n```\npip install git+https://github.com/decorator-factory/py2-nostalgia\n```\n\n_(please don't actually use this)_\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecorator-factory%2Fpy2-nostalgia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecorator-factory%2Fpy2-nostalgia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecorator-factory%2Fpy2-nostalgia/lists"}