{ "info": { "author": "Marco Poletti", "author_email": "poletti.marco@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "\n\n.. image:: https://img.shields.io/travis/google/tmppy/master.svg?label=Linux/OSX%20build/tests\n :target: https://travis-ci.org/google/tmppy\n :alt: Build Status\n\n\nTMPPy is a subset of Python that can be compiled to C++ meta-functions using the ``py2tmp`` compiler.\nThis project is aimed at C++ library developers whose libraries include a non-trivial amount of C++\nmetaprogramming.\n\nCompared to writing C++ metaprogramming code directly, using TMPPy allows that code to be expressed in a\nmore concise and readable way, provides static type checking (avoiding some classes of instantiation-time\nerrors) and produces optimized C++ meta-functions, reducing the compile time for the C++ compilation.\n\nExample\n~~~~~~~\n\nAs an example, let's write a metafunction (aka type trait class) ``add_pointer_multiple`` such that:\n\n\n* ``add_pointer_multiple::type`` is ``T``\n* ``add_pointer_multiple::type`` is ``T*``\n* ``add_pointer_multiple::type`` is ``T**``\n* (and so on)\n\nThis can be written as a template, as follows:\n\n.. code-block::\n\n template \n struct add_pointer_multiple {\n using type = typename add_pointer_multiple::type*;\n };\n\n template \n struct add_pointer_multiple {\n using type = T;\n };\n\n\nHowever this syntax is quite verbose and not very readable. For more complex metafunctions this becomes a significant issue, leading to more bugs and more effort when debugging or maintaining the code.\n\nSome C++ metaprogramming libraries (notably Boost's MPL library) can be used to reduce the verbosity, however that comes at the price of slower compile times.\n\nUsing TMPPy, the above can be written as:\n\n.. code-block::\n\n def add_pointer_multiple(t: Type, n: int) -> Type:\n if n == 0:\n return t\n else:\n return Type('T*', T=add_pointer_multiple(t, n-1))\n\n\nAnd this TMPPy code can then be compiled to C++ code equivalent to the metafunction above (without the overhead of e.g. MPL).\n\nFor more information on TMPPy, see `the wiki `_.\n\nLicense\n~~~~~~~\n\nTMPPy is released under the Apache 2.0 license. See the ``LICENSE`` file for details.\n\nThis is not an official Google product.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/google/tmppy", "keywords": "C++ metaprogramming compiler templates", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "TMPPy", "package_url": "https://pypi.org/project/TMPPy/", "platform": "", "project_url": "https://pypi.org/project/TMPPy/", "project_urls": { "Homepage": "https://github.com/google/tmppy" }, "release_url": "https://pypi.org/project/TMPPy/0.1.3/", "requires_dist": null, "requires_python": ">=3", "summary": "A subset of Python that can be compiled to C++ meta-functions using the py2tmp compiler", "version": "0.1.3" }, "last_serial": 3288486, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "62c5158de7bbe5797ca663eb5d668460", "sha256": "1c6ee930762f7c27efc90bc5b60af03c319487018d4a21da8ad0c9b4af173edc" }, "downloads": -1, "filename": "TMPPy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "62c5158de7bbe5797ca663eb5d668460", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 60459, "upload_time": "2017-10-29T10:19:05", "url": "https://files.pythonhosted.org/packages/24/1c/450eb0ade8b80b1fde75ae7a99bb6cc833ea95db97913fe5ee8d42c37f10/TMPPy-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "999da8f241f6c3fd70229830aef27e07", "sha256": "8a08e5447ce31ef17cbb858d17ffacb47372d864e79fcbbc8350546fc0069ec9" }, "downloads": -1, "filename": "TMPPy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "999da8f241f6c3fd70229830aef27e07", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 52306, "upload_time": "2017-10-29T10:19:07", "url": "https://files.pythonhosted.org/packages/d6/f8/2cb569507cd6bd3e1e0d4b3edd00ac7160897d78148053ac5336f084e1c0/TMPPy-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "909f18172e6bbfbb85b0c3c783cb98a4", "sha256": "c0caa3027a686700f1d6c1c8e9e48459b69de5c64625b0d7da016b2289ff030e" }, "downloads": -1, "filename": "TMPPy-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "909f18172e6bbfbb85b0c3c783cb98a4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 60523, "upload_time": "2017-10-29T10:26:18", "url": "https://files.pythonhosted.org/packages/09/41/3e44f97b460f9c99b4fb5b5ec990da5226d31c6f177a15764d263ec13151/TMPPy-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "070257392bc7d2ca218cc4f4b6ad345a", "sha256": "ba40ff1e4886e06a6eee0d1450d28ffc65f46be699774c63d4846ebec0eb351d" }, "downloads": -1, "filename": "TMPPy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "070257392bc7d2ca218cc4f4b6ad345a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 52414, "upload_time": "2017-10-29T10:26:19", "url": "https://files.pythonhosted.org/packages/31/86/6ac257db9f6279ecc78953d745ff93e2705a8ffc510681a54bb5364cf094/TMPPy-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "cb81fb510f9a799bd320334f08ebbd20", "sha256": "b33e55ce4079b880df51c9a32c850cf9a67ae43d9e2b58b75a5bdb9d43d07581" }, "downloads": -1, "filename": "TMPPy-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "cb81fb510f9a799bd320334f08ebbd20", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 61860, "upload_time": "2017-10-29T10:51:25", "url": "https://files.pythonhosted.org/packages/d3/28/9305096dc40138136dd9ed49edc400e9bd3f5afceeeb9bca93c0c186ef1e/TMPPy-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2392aa6ea22c2aabf58faac83d7af516", "sha256": "d0965cb20ecb4cd27f8e1c3ce8ae9bfc03fab8330027b1397cb1d72aca401648" }, "downloads": -1, "filename": "TMPPy-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2392aa6ea22c2aabf58faac83d7af516", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 52426, "upload_time": "2017-10-29T10:51:26", "url": "https://files.pythonhosted.org/packages/2f/df/d52c03327759e6e8e7ccb13894bd24e83a88364f025c1d266891af6c595d/TMPPy-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "67139cce14a4f9a1cc892f619e1d3b5e", "sha256": "91ee12409478a515e234109af91d0007ce3cdf634b359aa545805b2d5adaae8f" }, "downloads": -1, "filename": "TMPPy-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "67139cce14a4f9a1cc892f619e1d3b5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 61970, "upload_time": "2017-10-29T11:18:11", "url": "https://files.pythonhosted.org/packages/b3/47/62a89bf5ad12147349897ddcca808a464e022342d640b0576182770bddef/TMPPy-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2fbca6c4e9c4d02513944fa7c388eccf", "sha256": "841ceb0352284c8ed166c03abd9df1d403d4c259a04f06fd49889beb426757c1" }, "downloads": -1, "filename": "TMPPy-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2fbca6c4e9c4d02513944fa7c388eccf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 52594, "upload_time": "2017-10-29T11:18:13", "url": "https://files.pythonhosted.org/packages/92/db/22b144db5aa768287490cff32da93b72a5ee98716a88746b4a9534bff4bd/TMPPy-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "67139cce14a4f9a1cc892f619e1d3b5e", "sha256": "91ee12409478a515e234109af91d0007ce3cdf634b359aa545805b2d5adaae8f" }, "downloads": -1, "filename": "TMPPy-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "67139cce14a4f9a1cc892f619e1d3b5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 61970, "upload_time": "2017-10-29T11:18:11", "url": "https://files.pythonhosted.org/packages/b3/47/62a89bf5ad12147349897ddcca808a464e022342d640b0576182770bddef/TMPPy-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2fbca6c4e9c4d02513944fa7c388eccf", "sha256": "841ceb0352284c8ed166c03abd9df1d403d4c259a04f06fd49889beb426757c1" }, "downloads": -1, "filename": "TMPPy-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2fbca6c4e9c4d02513944fa7c388eccf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 52594, "upload_time": "2017-10-29T11:18:13", "url": "https://files.pythonhosted.org/packages/92/db/22b144db5aa768287490cff32da93b72a5ee98716a88746b4a9534bff4bd/TMPPy-0.1.3.tar.gz" } ] }