{ "info": { "author": "thautwarm", "author_email": "twshere@outlook.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# Moshmosh\n\n![example.png](https://raw.githubusercontent.com/thautwarm/moshmosh/master/example.png)\n\nThe TRUE implementation of pattern matching for Python.\n\nFor more than pattern matching, check `syntax_rule.py`.\n\n```python\n@syntax_rule(pattern_matching)\ndef f(x, r=1):\n with match(x):\n if case[0]: return 1\n if case[x]: return f(x-1, r * x)\n\nreturn f(10)\n```\n\n# Features\n\n- [x] Tree pattern matching: `if C1(C2(1), \"\"): ...`\n\n- [x] Unlike projects using `inspect.getsource`, syntax extensions are achieved without evil IO operations or requiring source files.\n\n- [x] Literal patterns:\n - [x] string, number and other constant patterns\n - [x] tuple, list patterns\n\n- [x] Provided with the capabilities to customize semantics of python syntaxes.\n\n# Benchmarks\n\nCheck benchmark.py.\n\nAlthough Pampy is much weaker than moshmosh, it's also much slower than moshmosh :) .\nNote tha moshmosh is currently a simple prototype implemented in few hours.\n\nThus we can safely conclude, **A true one is always better than the fakers**.\n\n## Acknowledgements\n\nSee [older implementations](http://www.grantjenks.com/docs/patternmatching/#alternative-packages) and search \"pattern matching\" in [Python-ideas](https://mail.python.org/archives/list/python-ideas@python.org/).\n\nSalute all the people used to work for Python pattern matching.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thautwarm/moshmosh", "keywords": "syntax extension,macro,pattern matching", "license": "mit", "maintainer": "", "maintainer_email": "", "name": "moshmosh-syntax", "package_url": "https://pypi.org/project/moshmosh-syntax/", "platform": "any", "project_url": "https://pypi.org/project/moshmosh-syntax/", "project_urls": { "Homepage": "https://github.com/thautwarm/moshmosh" }, "release_url": "https://pypi.org/project/moshmosh-syntax/0.1.1/", "requires_dist": [ "uncompyle6" ], "requires_python": ">=3", "summary": "A hygienic syntax extension system for Python", "version": "0.1.1" }, "last_serial": 5526303, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f6dfa647f7d074446516de0c4fd3b4af", "sha256": "2684991b960ed3bae67b2cfaf0e3f35c9173ffba4c7fa31106af9d321aaff226" }, "downloads": -1, "filename": "moshmosh_syntax-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f6dfa647f7d074446516de0c4fd3b4af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8015, "upload_time": "2019-07-13T07:28:11", "url": "https://files.pythonhosted.org/packages/82/34/ec0c80bb23d2b895b02f3dd9a03bb200b9ce44fbbdbda3b9cd4711f416c5/moshmosh_syntax-0.1.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6dfa647f7d074446516de0c4fd3b4af", "sha256": "2684991b960ed3bae67b2cfaf0e3f35c9173ffba4c7fa31106af9d321aaff226" }, "downloads": -1, "filename": "moshmosh_syntax-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f6dfa647f7d074446516de0c4fd3b4af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 8015, "upload_time": "2019-07-13T07:28:11", "url": "https://files.pythonhosted.org/packages/82/34/ec0c80bb23d2b895b02f3dd9a03bb200b9ce44fbbdbda3b9cd4711f416c5/moshmosh_syntax-0.1.1-py3-none-any.whl" } ] }