naftaliharris / tauthon Goto Github PK
View Code? Open in Web Editor NEWFork of Python 2.7 with new syntax, builtins, and libraries backported from Python 3.
License: Other
Fork of Python 2.7 with new syntax, builtins, and libraries backported from Python 3.
License: Other
https://www.python.org/dev/peps/pep-0498 and https://docs.python.org/3.6/reference/lexical_analysis.html#f-strings
shouldn't conflict with any pre-existing valid code
The first thing you want to do after compiling / installing Tauthon is probably to install third party products like numpy and scipy.
pip install [package]
This should just work out of the box.
I using help().
Release Derived Year Owner GPL-
from compatible? (1)
0.9.0 thru 1.2 1991-1995 CWI yes
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
1.6 1.5.2 2000 CNRI no
2.0 1.6 2000 BeOpen.com no
1.6.1 1.6 2001 CNRI yes (2)
2.1 2.0+1.6.1 2001 PSF no
2.0.1 2.0+1.6.1 2001 PSF yes
2.1.1 2.1+2.0.1 2001 PSF yes
2.1.2 2.1.1 2002 PSF yes
2.1.3 2.1.2 2002 PSF yes
2.2 and above 2.1.1 2001-2015 PSF yes
Tauthon 2.8+ 2.7.10 2015-now PSF yes
Function annotations
I apologize if discussion has already happened on this feature request.
If someone wants to use a C library that uses C99 or a C++ library that uses C++11 or later, that is not possible with Python 2.7 because it (and every C/C++ compiled module) are built with Visual Studio 2008. Building with the UCRT would offer a way forward for people who want Python 2.x and modern C and C++ libraries to work together on Windows.
Blocked by #23
I'm about to create a Tauthon debugging environment (yes, after LOTS of consideration and experimentation, python3 was a lesser option due to various reasons I won't discuss here) and plan to add Tauthon specific features.
What are your stand on adding (library enhancements, not language) features not present in Python3, especially additions to libraries like ctypes?
My Tauthon scripts probably will not run on either python2.7 or python3 (regardless of any library enhancements). I think in that case I should have another file-extension to avoid confusion. What is your stance on this? Is ".tau" something pretty we could live with (and ".py" only if backwards compatible with Python2.7) ? :-)
└─╼ ./tauthon.exe
Tauthon 2.8.0a0 (default, Feb 24 2017, 00:03:02)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
help()
Welcome to Python 2.8! This is the online help utility.
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.8/tutorial/.
========
looks like it's coming from here in pydoc
grep -n Welcome tauthon-master/Lib/pydoc.py
1859:Welcome to Python %s! This is the online help utility.
grep -n Internet tauthon-master/Lib/pydoc.py
1862:the tutorial on the Internet at http://docs.python.org/%s/tutorial/.
>>> import inspect
>>> def f((a, b)): pass
...
>>> inspect.signature(f)
<Signature (implicit0, /)>
>>>
└─╼ ./tauthon.exe
Tauthon 2.8.0a0 (default, Feb 24 2017, 00:03:02)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
license()
A. HISTORY OF THE SOFTWARE
...
Release Derived Year Owner GPL-
...
2.2 and above 2.1.1 2001-now PSF yes
...
owner of tauthon is likely not ?PSF
...but do it so that it's not a keyword...
>>> import platform
>>> platform.python_implementation()
'CPython'
I guess you may want to change that to Tauthon to avoid confusion with upstream CPython.
$ ./python.exe -3 Lib/test/test_coroutines.py
>>> async def f(): pass
>>> help(f())
gives:
Help on coroutine object:
f = class coroutine(object)
| Methods defined here:
|
| __await__(...)
| __await__($self, /)
| --
|
| Return an iterator to be used in await expression.
|
Already ported to 2.7, should be easy to integrate:
https://github.com/google/python-subprocess32
the tauthon docs do a nice job of describing what's been ported to tauthon. it would be helpful to have a feature list available during execution, so developers could test whether or not it's been implemented in their build of tauthon or not.
possibly implemented by a "what'snewintauthon" module which could be imported. each feature could be indicated by an entry in a tuple or list, or by a dictionary entry with e.g. yes/no/partial entries.
likewise, this might also be applicable to 2.7.x features with needed to be broken by tauthon or which have not yet been incorporated into the base
Hi, it would be great if the new HTML functions (specifically, escape
and unescape
) could be exported.
Thanks!
using the platform module, in a vanilla python, the version of python is found using , e,g, 2.7.13. with tauthon standing in for the python in many places how would a running program be able to determine whether it's 2.7.13 based or 2.7.14
using tauthon:
"""
In[20]: import platform
In [21]: platform.python_version()
Out[21]: '2.8.0a0'
In [22]: platform.python_version_tuple()
Out[22]: ('2', '8', '0a0')
"""
while the platform module might be modified to to show both the tauthon version and the base python, it night be useful to have a new module that could be imported by tauthon
https://docs.python.org/3.6/whatsnew/3.6.html#whatsnew36-pep520
https://www.python.org/dev/peps/pep-0520/
https://www.python.org/dev/peps/pep-0468/
should just require changing the dict's internal code to pypy's approach as done here
└─╼ ./tauthon.exe
Python 2.8.0a0 (default, Feb 23 2017, 16:57:01)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
seems that Python 2.8.0a0. should be tauthon2.8.0a0 ?
running on OS X
$ ./python.exe Demo/parser/test_unparse.py
fails with (eventually):
FAILED (errors=1)
Traceback (most recent call last):
File "Demo/parser/test_unparse.py", line 213, in <module>
test_main()
File "Demo/parser/test_unparse.py", line 210, in test_main
test_support.run_unittest(UnparseTestCase, DirectoryTestCase)
File "/Users/naftali/repos/cpython/Lib/test/test_support.py", line 1470, in run_unittest
_run_suite(suite)
File "/Users/naftali/repos/cpython/Lib/test/test_support.py", line 1453, in _run_suite
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
File "Demo/parser/test_unparse.py", line 206, in test_files
self.check_roundtrip(source)
File "Demo/parser/test_unparse.py", line 85, in check_roundtrip
unparse.Unparser(ast1, unparse_buffer)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 35, in __init__
self.dispatch(tree)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 63, in dispatch
meth(tree)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 75, in _Module
self.dispatch(stmt)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 63, in dispatch
meth(tree)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 246, in _ClassDef
self.dispatch(t.body)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 60, in dispatch
self.dispatch(t)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 63, in dispatch
meth(tree)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 250, in _FunctionDef
self.__FunctionDef_helper(t, "def")
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 265, in __FunctionDef_helper
self.dispatch(t.body)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 60, in dispatch
self.dispatch(t)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 63, in dispatch
meth(tree)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 80, in _Expr
self.dispatch(tree.value)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 63, in dispatch
meth(tree)
File "/Users/naftali/repos/cpython/Demo/parser/unparse.py", line 471, in _BinOp
self.write(" " + self.binop[t.op.__class__.__name__] + " ")
KeyError: 'MatMult'
OSX 10.12.3 (Sierra)
there are a number of env vars used by tauthon as shown by help:
"""
└─╼ tauthon -h | egrep -i "PY|TAU"
usage: tauthon [option] ... [-c cmd | -m mod | file | -] [arg] ...
-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x
-d : debug output from parser; also PYTHONDEBUG=x
-E : ignore PYTHON* environment variables (such as PYTHONPATH)
if stdin does not appear to be a terminal; also PYTHONINSPECT=x
-O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x
-s : don't add user site directory to sys.path; also PYTHONNOUSERSITE
-u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x
-v : verbose (trace import statements); also PYTHONVERBOSE=x
also PYTHONWARNINGS=arg
PYTHONSTARTUP: file executed on interactive startup (no default)
PYTHONPATH : ':'-separated list of directories prefixed to the
PYTHONHOME : alternate directory (or :<exec_prefix>).
The default module search path uses /pythonX.X.
PYTHONCASEOK : ignore case in 'import' statements (Windows).
PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.
PYTHONHASHSEED: if this variable is set to 'random', the effect is the same
"""
note: python3 supports all of these plus
"""
PYTHONFAULTHANDLER: dump the Python traceback on fatal errors.
PYTHONMALLOC: set the Python memory allocators and/or install debug hooks
"""
do any of these need TAUTHON analogs? if so, should the PYTHON one then be ignored?
is there a need to allow for different values for tauthon and python applications.
perhaps, for the time being it isn't necessary to do anything.
symtable_visit_annotations
refers to FunctionDef.args
; but also gets called with async functions. (See the version of it in 3.5.2, e.g.).
I think this is commit 53ab3ba, among others.
People may depend on the behavior of these when parsing data input.
Needs #11
The current name might confuse people into thinking this was an official port, filing bugs on the official bug tracker for it and so on.
There will never be an official Python 2.8, so there should never be something called “Python 2.8” or similar.
@gvanrossum might confirm this if you don't believe my words.
OSX 10.12.3 (Sierra)
"""
$ make install | grep man | egrep -v 'command|roman|manager'
...
/usr/bin/install -c -m 644 ./Misc/python.man
/usr/local/share/man/man1/python2.8.1
rm -f /usr/local/share/man/man1/python2.1
(cd /usr/local/share/man/man1; ln -s python2.8.1 python2.1)
rm -f /usr/local/share/man/man1/python.1
(cd /usr/local/share/man/man1; ln -s python2.1 python.1)
"""
"""
└─╼ man -w python2.8
/usr/local/share/man/man1/python2.8.1
"""
"""man python2.8
PYTHON(1) PYTHON(1)
NAME
python - an interpreted, interactive, object-oriented programming lan-
guage
SYNOPSIS
python [ -B ] [ -d ] [ -E ] [ -h ] [ -i ] [ -m module-name ]
[ -O ] [ -OO ] [ -R ] [ -Q argument ] [ -s ] [ -S ] [ -t ] [ -u
]
[ -v ] [ -V ] [ -W argument ] [ -x ] [ -3 ] [ -? ]
[ -c command | script | - ] [ arguments ]
DESCRIPTION
Python is an interpreted,
"""
if there will be tauthon man page, does it need to be tauthonized ?
Would you consider adding a contrib/ folder with a few useful-to-haves like get-pip.py, perhaps a port of google's pytype for python2.8, or other tools? The python source is normally meant for ppl experimenting with the compiler and therefore lacks a few of the things you'd want in a download like this that is intended for a wider audience. Makes sense if you're not considering this for the time being though - obviously you've gone out of your way to not add anything outside the python3 PEPs.
If nothing else, having a anaconda style wrapper around this (even if not provided by continuum) would make it a lot easier for people to get started, and therefore for ppl to share their tools based on it.
$ ./python.exe Lib/test/test_coroutines.py
produces
...
test_set_wrapper_3 (__main__.SysSetCoroWrapperTest) ... Lib/test/test_coroutines.py:1389: RuntimeWarning: coroutine 'foo' was never awaited
sys.set_coroutine_wrapper(None)
ok
...
not sure if itauthon is needed - it could be the analog of ipython, or it could be a wrapper like isympy which does a few helpful things for sympy by pre-populating.
"""
ipython:
if name == 'main':
import sys
import IPython
sys.exit(IPython.start_ipython())
"""
"""
└─╼ isympy -h
Python shell for SymPy.
This is just a normal Python shell (IPython shell if you have the
IPython package installed), that executes the following commands for
the user:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()
"""
(Since they'll be initialized to 0 in C-extensions).
kwonlyargcount is not, I believe.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.