{ "info": { "author": "kai zhu", "author_email": "kaizhu256@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: Public Domain", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Operating System :: Unix", "Programming Language :: C", "Topic :: Education :: Testing", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Compilers", "Topic :: Software Development :: Debuggers", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing", "Topic :: Utilities" ], "description": "################################################################################\r\nREVISION DATE: 20081023\r\n\r\nAUTHOR: kai zhu - kaizhu@hpc.usc.edu\r\n\r\nHOMEPAGE: http://www-rcf.usc.edu/~kaizhu/work/py3to2/old/extension\r\n\r\nABSTRACT:\r\n this is a minimal, standalone, proof-of-concept extension module for\r\npython2.6, emulating limited python3.0 syntax behavior, thru usage of some\r\nbackported opcodes from python3.0. it is intended as a curiousity for hackers.\r\n\r\n this module is derived from py3to2. the difference is that this is a\r\nstandalone module which requires no patching of python2.6 to work.\r\nthe tradeoff is that it is not 100& py3k language compliant, as py3to2\r\nnearly is (see LIMITATIONS).\r\n\r\n i wrote this module b/c i kno many ppl r loathe to patch their python-2.6 src\r\nin order to run py3to2. this is a compromise, but plz note it has severe\r\nlimitations.\r\n\r\nMECHANISM:\r\n 1. upon init, py3k_extension starts up a py3k server w/ pipe io.\r\n\r\n 2. -> received via pipe io from py3k_extension, the py3k server 1st\r\n natively compiles the src code into a py3k codeobj, then converts it\r\n to py2x format w/ the addition of the backported opcodes.\r\n\r\n 3. <- the serialized py2x codeobj is piped back to py3k_extension,\r\n which unserializes it & eval/exec it as normal.\r\n\r\nin theory, this mechanism should transparently implement any bytecode-level py3k\r\nlanguage feature. performance and robustness should b minimally impacted, since\r\nthe compiled code is directly run as native 2.x++ bytecode.\r\n\r\nBACKWARD COMPATIBILITY:\r\n since this is a standalone extension module which doesn't modify python's\r\nsource code in any way, there shouldn't b any backward compatibility issues as\r\nlong as the module is not imported\r\n\r\n################################################################################\r\n\r\nLIMITATIONS:\r\n as a minimal extension module, this module DOES NOT SUPPORT CLASSES,\r\nIMPORTING PY3K MODULES, OR FUNCTION KEYWORD-ONLY ARGUMENTS.\r\nany py3k code containing classes will not work.\r\n\r\nPY3K FEATURES TESTED TO WORK:\r\n pep3104 Access to Names in Outer Scopes\r\n pep3112 Bytes literals in Python 3000\r\n pep3113 Removal of Tuple Parameter Unpacking\r\n pep3132 Extended Iterable Unpacking\r\n\r\nREQUIREMENTS:\r\n * linux / unix (windows has io problems w/ py3k server)\r\n\r\nBUILD/INSTALL: python setup.py build install\r\n\r\nUSAGE:\r\n this module provides 3 wrapper functions similar to what's in python-3.0's\r\nbuiltins:\r\n - py3k_compile(code, filename, mode, flags, dont_inherit)\r\n - py3k_eval(code, globals = None, locals = None)\r\n - py3k_exec(code, globals = None, locals = None)\r\n\r\nEXAMPLE:\r\n Python 2.6 (r26:66714, Oct 19 2008, 02:49:13)\r\n [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2\r\n Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n >>>\r\n >>> import py3k_extension\r\n created read/write pipes: (4, 5)\r\n py3k server starting with pipes in/out/err: 7 5 -2\r\n py3k server: Python 3.0rc1 (r30rc1:66499, Oct 15 2008, 15:43:09)\r\n py3k server: [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2\r\n py3k server: Type \"help\", \"copyright\", \"credits\" or \"license\" for more\r\ninformation.\r\n py3k server: >>> ''\r\n >>>\r\n >>> py3k_exec( \"a, *b = 1,2,3\" ) # pep3132 Extended Iterable Unpacking\r\n >>> print a, b\r\n 1 [2, 3]\r\n >>>\r\n################################################################################\r\n\r\nCHANGELOG:\r\n20081023\r\n created a standalone extension module w/ limited capabilities\r\n20081019\r\n ported to python-2.6\r\n consolidate & simplify patches to 1 file: ceval.c\r\n created extension module builtins_py3k\r\n revamped import hook again\r\n removed unicode support & restrict source code to ascii-only\r\n20080727\r\n revampled import hook\r\n20080911\r\n consolidate patches to 2 files: bltinmodule.c & ceval.c\r\n20080828\r\n add kwonlyargcount 'attr' to codeobj\r\n add __annotations__ & __kwdefaults__ attr to funcobj\r\n add __pseudomethod__ feature to baseobj\r\n20080819\r\n pure python import hook - removed magic comment & use magic path instead\r\n revamped str & bytes handling\r\n revamped py3k .pyc file handling\r\n20080802\r\n pep3135 New Super\r\n20080717\r\n pep3107 Function Annotations\r\n pep3120 Using UTF-8 as the default source encoding\r\n pep3131 Supporting Non-ASCII Identifiers\r\n20080713\r\n import / reload works transparently on py3k scripts using a magic comment\r\n added pep3102 Keyword-Only Arguments\r\n20080709 added a py3k preparser\r\n20080702\r\n rewrote py3k server's pipe io. implemented partial bytearray & bytes class.\r\n wrote a few simple tests\r\n20080630\r\n __build_class__ function to bltmodule.c. tested class decorators to b working.\r\n################################################################################", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www-rcf.usc.edu/~kaizhu/work/py3to2/old/extension", "keywords": "", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "py3k_extension", "package_url": "https://pypi.org/project/py3k_extension/", "platform": "linux", "project_url": "https://pypi.org/project/py3k_extension/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www-rcf.usc.edu/~kaizhu/work/py3to2/old/extension" }, "release_url": "https://pypi.org/project/py3k_extension/20081023/", "requires_dist": null, "requires_python": null, "summary": "extension module backporting opcodes from python3k", "version": "20081023" }, "last_serial": 796873, "releases": { "0.1.0": [], "20081023": [ { "comment_text": "", "digests": { "md5": "b93c5e40543eec04012bf991f172dc50", "sha256": "588b2171107a44ea7c5a1279b07a9519639caa1ceb562b1fc1d4424c50c3a325" }, "downloads": -1, "filename": "py3k_extension-20081023.tar.gz", "has_sig": false, "md5_digest": "b93c5e40543eec04012bf991f172dc50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 51926, "upload_time": "2008-10-23T18:32:51", "url": "https://files.pythonhosted.org/packages/6c/83/cd02f446ae767c95db478c6c9abe08169c47ac6f56a41e2b359f56ef534a/py3k_extension-20081023.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b93c5e40543eec04012bf991f172dc50", "sha256": "588b2171107a44ea7c5a1279b07a9519639caa1ceb562b1fc1d4424c50c3a325" }, "downloads": -1, "filename": "py3k_extension-20081023.tar.gz", "has_sig": false, "md5_digest": "b93c5e40543eec04012bf991f172dc50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 51926, "upload_time": "2008-10-23T18:32:51", "url": "https://files.pythonhosted.org/packages/6c/83/cd02f446ae767c95db478c6c9abe08169c47ac6f56a41e2b359f56ef534a/py3k_extension-20081023.tar.gz" } ] }