{"id":17350483,"url":"https://github.com/pilosus/c3linear","last_synced_at":"2025-06-30T22:06:01.425Z","repository":{"id":62560596,"uuid":"174369988","full_name":"pilosus/c3linear","owner":"pilosus","description":"Naive C3 linearization algorithm tutorial","archived":false,"fork":false,"pushed_at":"2019-03-08T12:36:59.000Z","size":13,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-22T07:56:37.563Z","etag":null,"topics":["algorithms","inheritance","mro","python","tutorial"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pilosus.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-03-07T15:23:56.000Z","updated_at":"2024-11-15T15:38:11.000Z","dependencies_parsed_at":"2022-11-03T14:45:28.197Z","dependency_job_id":null,"html_url":"https://github.com/pilosus/c3linear","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pilosus/c3linear","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Fc3linear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Fc3linear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Fc3linear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Fc3linear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilosus","download_url":"https://codeload.github.com/pilosus/c3linear/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilosus%2Fc3linear/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262857265,"owners_count":23375491,"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":["algorithms","inheritance","mro","python","tutorial"],"created_at":"2024-10-15T17:07:06.260Z","updated_at":"2025-06-30T22:06:01.202Z","avatar_url":"https://github.com/pilosus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C3 Linearization Algorithm\n\n`c3linear` is a naïve implementation of\n[C3 linearization](https://en.wikipedia.org/wiki/C3_linearization)\nalgorithm. C3 used in Python 2.3+ for\n[Method Resolution Order](https://www.python.org/download/releases/2.3/mro/).\nSee Raymond Hettinger's\n[Python’s super() considered super!](https://rhettinger.wordpress.com/2011/05/26/super-considered-super/)\nfor more information.\n\n# Motivation\n\nThe project has come to life as a byproduct of debugging an\novercomplicated hierarchy of mixin classes.  I thought I knew how\nexactly MRO is computed, but it turned out I didn't.\n\nI've tried to keep the code idiomatic and easy to follow at the\nexpense of performance. The project is really took a couple of hours\nto complete.  Although I didn't care about time complexity and didn't\ncheck correctness as thoroughly as I should, I think the project may\nhelp someone who wants to learn how Python's Method Resolution Order\nworks.\n\n# Usage\n\n## Library\n\n* Get the code and install it with `python setup.py install` (Python\n  3.6+ required)\n* Import `from c3linear.mro import mro`\n* Check against built-in MRO:\n```python\n\u003e\u003e\u003e class A: pass\n\u003e\u003e\u003e class B(A): pass\n\u003e\u003e\u003e mro(B) == B.mro()\nTrue \n``` \n\nTake a look at `tests` for more examples.\n\n## Testing\n\n* Install dependencies:\n```shell\npip install -e .\n```\n* (Optional) Install extra packages:\n```shell\npip install -e .[extra]\n```\n* Run tests with:\n```shell\npython setup.py test\n```\n* Run `flake8` for PEP8 compliance testing:\n```shell\npython setup.py flake8\n```\n* Run `mypy`:\n```shell\nmypy c3linear/\n```\n\n# Contributing\n\nIf you've found a bug, please open an issue describing the problem first.\n\n\n# Licence\n\nThe project is licensed under MIT License. For further information see\n`LINCENSE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilosus%2Fc3linear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilosus%2Fc3linear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilosus%2Fc3linear/lists"}