{"id":18404438,"url":"https://github.com/masipcat/invars","last_synced_at":"2025-04-12T19:33:47.487Z","repository":{"id":62571318,"uuid":"160864180","full_name":"masipcat/invars","owner":"masipcat","description":"Single assignment variables in Python","archived":false,"fork":false,"pushed_at":"2018-12-07T23:59:37.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T18:57:20.810Z","etag":null,"topics":["functional-programming","python","single-assignment"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masipcat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-07T19:00:27.000Z","updated_at":"2018-12-09T11:15:10.000Z","dependencies_parsed_at":"2022-11-03T16:46:49.799Z","dependency_job_id":null,"html_url":"https://github.com/masipcat/invars","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masipcat%2Finvars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masipcat%2Finvars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masipcat%2Finvars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masipcat%2Finvars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masipcat","download_url":"https://codeload.github.com/masipcat/invars/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248621411,"owners_count":21134841,"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":["functional-programming","python","single-assignment"],"created_at":"2024-11-06T02:51:49.709Z","updated_at":"2025-04-12T19:33:47.455Z","avatar_url":"https://github.com/masipcat.png","language":"Python","readme":"# invars\n\nThis package brings *invariable variables* or **single assignment variables** to Python (like in [Erlang](http://erlang.org/doc/reference_manual/expressions.html#variables) and other functional programming languages).\n\n**Examples**\n\n```python\none = 1\ntwo = 2\n...\ntwo += one  # invalid!\n```\n\n```python\ntotal = 0\nfor i in range(4):\n    total += i  # invalid!\n```\n\n## Installation\n\n```console\n$ pip install invars\n```\n\n## Usage\n\n```\n$ invars my_script.py\n```\n\n\n## Why?\n\n\u003e  In functional programming, assignment is discouraged in favor of single assignment. [...] Imperative assignment can introduce side effects while destroying and making the old value unavailable while substituting it with a new one\n\n\n[Wikipedia](https://en.wikipedia.org/wiki/Assignment_%28computer_science%29#Single_assignment)\n\n\u003e Single assignment variables simplifies a lot of things because it takes out the \"time\" variable from your programs.\n\n[Stack Overflow](https://stackoverflow.com/questions/11255632/the-purpose-of-single-assignment)\n\n\n## TODO\n\n - [ ] Integrate with `flakes8`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasipcat%2Finvars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasipcat%2Finvars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasipcat%2Finvars/lists"}