{ "info": { "author": "Vitaly R. Samigullin", "author_email": "vrs@pilosus.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Education", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Education", "Typing :: Typed" ], "description": "# C3 Linearization Algorithm\n\n`c3linear` is a na\u00efve 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\u2019s 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>>> class A: pass\n>>> class B(A): pass\n>>> 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\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/pilosus/c3linear/archive/0.1.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pilosus/c3linear", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "c3linear", "package_url": "https://pypi.org/project/c3linear/", "platform": "", "project_url": "https://pypi.org/project/c3linear/", "project_urls": { "Download": "https://github.com/pilosus/c3linear/archive/0.1.1.tar.gz", "Homepage": "https://github.com/pilosus/c3linear" }, "release_url": "https://pypi.org/project/c3linear/0.1.1/", "requires_dist": [ "mypy ; extra == 'extra'" ], "requires_python": ">=3.6", "summary": "A naive implementation of C3 linearization algorithm used in Python's MRO", "version": "0.1.1" }, "last_serial": 4924557, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "322454aae0fda052e48eab6d88517969", "sha256": "37219ea931c7dee6d69b50f64f62e81dd0fc7d0d918d3e8ee6b312f50fb7ef14" }, "downloads": -1, "filename": "c3linear-0.1.0-py3.6.egg", "has_sig": false, "md5_digest": "322454aae0fda052e48eab6d88517969", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": ">=3.6", "size": 9955, "upload_time": "2019-03-11T11:03:20", "url": "https://files.pythonhosted.org/packages/37/f4/ca5c2808c3beedb6cc074053e7faacf6639f04cae78ae23d6a68cdfa1f86/c3linear-0.1.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "74b981d5a452341327d30cac9fa971de", "sha256": "e7dacf37c612a5a7460d361db635189097e44705fdc507db67d915e6e00c5a03" }, "downloads": -1, "filename": "c3linear-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "74b981d5a452341327d30cac9fa971de", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6289, "upload_time": "2019-03-11T11:03:16", "url": "https://files.pythonhosted.org/packages/66/b0/266191b3f2a4e9f0e87cff523eafd1292506a9e3fa949009caafa0edd199/c3linear-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fe78c805e1fbbb0aad2216192c7d76b6", "sha256": "235acb3142de66cf1844a61dda6a272e3957399f50d3e241455d413fc1ad6f08" }, "downloads": -1, "filename": "c3linear-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fe78c805e1fbbb0aad2216192c7d76b6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 5024, "upload_time": "2019-03-11T11:03:21", "url": "https://files.pythonhosted.org/packages/e2/a1/aad10d3a600509e4ad76acce839398965a6910e355757b18f9b1c0b85c21/c3linear-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "c7d51d7768158fc0947f5a52a36bdc46", "sha256": "8a13317aa4cee953638409fda054979960aed54873fb34cf2b41a341ca5cec3f" }, "downloads": -1, "filename": "c3linear-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c7d51d7768158fc0947f5a52a36bdc46", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6205, "upload_time": "2019-03-11T11:03:18", "url": "https://files.pythonhosted.org/packages/d2/df/439be04fae57dee88c386e3067678da6dbbea90c90ea3488868e2d84ee1d/c3linear-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3f80aafc9eea9474a65059aa4b43ed94", "sha256": "3f2c58d7e47d5b55788092e6eee23b937d56c6af14a404ac11f0cff39cb2c192" }, "downloads": -1, "filename": "c3linear-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3f80aafc9eea9474a65059aa4b43ed94", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4895, "upload_time": "2019-03-11T11:03:22", "url": "https://files.pythonhosted.org/packages/3b/60/f34b2300987e1bd7f81cbf1bdd1e0830e94ef061a6e5373a6ae7d333fc96/c3linear-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c7d51d7768158fc0947f5a52a36bdc46", "sha256": "8a13317aa4cee953638409fda054979960aed54873fb34cf2b41a341ca5cec3f" }, "downloads": -1, "filename": "c3linear-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "c7d51d7768158fc0947f5a52a36bdc46", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 6205, "upload_time": "2019-03-11T11:03:18", "url": "https://files.pythonhosted.org/packages/d2/df/439be04fae57dee88c386e3067678da6dbbea90c90ea3488868e2d84ee1d/c3linear-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3f80aafc9eea9474a65059aa4b43ed94", "sha256": "3f2c58d7e47d5b55788092e6eee23b937d56c6af14a404ac11f0cff39cb2c192" }, "downloads": -1, "filename": "c3linear-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3f80aafc9eea9474a65059aa4b43ed94", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4895, "upload_time": "2019-03-11T11:03:22", "url": "https://files.pythonhosted.org/packages/3b/60/f34b2300987e1bd7f81cbf1bdd1e0830e94ef061a6e5373a6ae7d333fc96/c3linear-0.1.1.tar.gz" } ] }