{"id":26368791,"url":"https://github.com/bindreams/overload","last_synced_at":"2025-03-16T22:49:02.656Z","repository":{"id":167685073,"uuid":"298197161","full_name":"bindreams/overload","owner":"bindreams","description":"Overload functions in python.","archived":false,"fork":false,"pushed_at":"2021-11-09T13:21:26.000Z","size":300,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-30T13:26:17.439Z","etag":null,"topics":["overloading","python3"],"latest_commit_sha":null,"homepage":"","language":"Cython","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/bindreams.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}},"created_at":"2020-09-24T07:08:47.000Z","updated_at":"2024-03-30T13:26:18.853Z","dependencies_parsed_at":"2023-09-11T02:01:48.793Z","dependency_job_id":null,"html_url":"https://github.com/bindreams/overload","commit_stats":null,"previous_names":["andreasxp/overload","bindreams/overload"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Foverload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Foverload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Foverload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bindreams%2Foverload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bindreams","download_url":"https://codeload.github.com/bindreams/overload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945478,"owners_count":20372894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["overloading","python3"],"created_at":"2025-03-16T22:49:02.169Z","updated_at":"2025-03-16T22:49:02.649Z","avatar_url":"https://github.com/bindreams.png","language":"Cython","readme":"# overload\nA python package that makes it possible to overload functions.  \nAn overloaded function has several signatures and definitions, one of which is picked depending on the arguments:\n```python\n@overload\ndef position(x, y):\n  print(f\"({x}, {y})\")\n\n@overload\ndef position(t: tuple):\n  print(f\"({t[0]}, {t[1]})\")\n\n@overload\ndef position(pos: QPoint):\n  print(f\"{pos.x()}, {pos.y()}\")\n\n\nposition(1, 2)  # Picks overload 1\nposition((1, 2))  # Picks overload 2\nposition(QPoint())  # Picks overload 3\n```\n\n## Installation\nThe recommended method of installation is through pip:\n```\npip install https://github.com/andreasxp/overload/archive/master.zip\n```\nSince this package is not yet published on PyPI, installing from Github is the only option.\n\n## Usage\nImport `overload` from the package:\n```python\nfrom overload import overload\n```\nUse it to overload functions or methods:\n```python\nclass Texture:\n  @overload\n  def __init__(self, color: int):\n    # create texture from a color code\n  \n  @overload\n  def __init__(self, image_path: str):\n    # create texture from an image\n```\n```python\n@overload\ndef print_sequence(*items):\n  print(\", \".join(items))\n\n@overload\ndef print_sequence(seq: list):\n  print_sequence(*seq)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbindreams%2Foverload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbindreams%2Foverload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbindreams%2Foverload/lists"}