Releases: TranscryptOrg/Transcrypt
3.9.1 Berlin
Updated README to reflect move of Transcrypt repo to TranscryptOrg
There are no new functional changes beyond 3.9.0 in this release.
3.9.0 Berlin
Initial release for Python 3.9 compatibility.
3.7.11 London
Many small and not so small fixes
-
Reporting of compilation errors fixed / improved
-
Dashes and underscores allowed in filenames by means of aliases
(see manual_tests/import_export_aliases)
3.7.4 London
Context managers added.
Builtin pow added.
3.7.3_rc2: Merge pull request #548 from eddieantonio/feature/gh-547-add-unicoded…
…ata-normalize [WIP] Add unicodedata.normalize()
3.7.3_rc1: Merge pull request #548 from eddieantonio/feature/gh-547-add-unicoded…
…ata-normalize [WIP] Add unicodedata.normalize()
3.7.3_rc3 London
Merge pull request #548 from eddieantonio/feature/gh-547-add-unicoded… …ata-normalize [WIP] Add unicodedata.normalize()
3.7.2 London (requires Python 3.7)
JavaScript 6 modules
Python 3.7 dataclasses
(Requires Python 3.7)
ES6 modules and PY3.7 dataclasses incl. inheritance, REQUIRES PYTHON 3.7
-
Dataclasses can now inherit from other dataclasses. Inheritance between dataclasses and ordinary classes is left out because it introduces overhead in all classes and in CPython lacks a proper method to call the parents
__init__
before a generated__init__
, which makes it hardly worthwhile. -
The dataclasses testlet shows some of the possibilities:
from dataclasses import dataclass from typing import ClassVar def getQ (): return 1002 @dataclass class A: m = 101010 n: int = 202020 @dataclass class B (A): p: int = 1001 q: int = 1002 @dataclass (order = True) class C (B): @dataclass class CC (B): k: int = 40 l: float = 55.5 j = 60 x: ClassVar = 10 y: int = 20 yy: int = 22 z: int = 30 zz: int = 33 t: ClassVar = 40 g = 100000 h = 100001 i = 100002 def getV (self): return 3 def setV (self, value): pass v = property (getV, setV) def getW (self): return 4 def setW (self, value): pass w: int = property (getW, setW) def f (self, p, autoTester): self.a = p self.b = 2000 autoTester.check (self.x, self.y, self.a) return f'something(a: {self.a}, b: {self.b})' @dataclass (order = True) class D: _p: int = 3 def setP (self, value): pass #self._p = value def getP (self): return 20 #return self._p p: int = property (getP, setP) def run (autoTester): c = C (y = 200, zz = 330) cc = C (y = 10200) c.f (123, autoTester) c.t = 400 cc.f (456, autoTester) cc.t = 4000 for obj in c, cc: autoTester.check (obj.x, obj.y, obj.yy, obj.z, obj.zz, obj.t, obj.a, obj.b) autoTester.check (repr (c)) autoTester.check (repr (cc)) #__pragma__ ('opov') autoTester.check (c == cc) autoTester.check (c != cc) autoTester.check (c < cc) autoTester.check (c > cc) # autoTester.check (c <= cc) # autoTester.check (c >= cc) autoTester.check (c == c) autoTester.check (c != c) autoTester.check (c < c) autoTester.check (c > c) autoTester.check (c <= c) autoTester.check (c >= c) d3 = D () d1 = D () d2 = D () autoTester.check (repr (d1)) autoTester.check (d3, d1, d3 > d1) autoTester.check (d2, d1, d2 > d1) autoTester.check (d3, d2, d3 > d2) ccc = C.CC () autoTester.check (ccc.n, ccc.p, ccc.q, ccc.k, ccc.l)
Output both in CPython and Transcrypt is:
- Code for property decorators has been slightly refactored
ES6 modules and PY3.7 dataclasses, REQUIRES PYTHON 3.7
Most functionality of the production release is present.
Some minor changes are to be expected to achieve better interop with webpack.
All local tests pass.
N.B. This release requires Python 3.7.0b3 or higher.
Following code now functions correctly:
from dataclasses import dataclass
from typing import ClassVar
@dataclass (order = True)
class C:
x: ClassVar = 10
y: int = 20
yy: int = 22
z: int = 30
zz: int = 33
t: ClassVar = 40
def f (self, p, autoTester):
self.a = p
self.b = 2000
autoTester.check (self.x, self.y, self.a)
return f'something(a: {self.a}, b: {self.b})'
def run (autoTester):
c = C (y = 200, zz = 330)
cc = C (y = 10200)
c.f (123, autoTester)
c.t = 400
cc.f (456, autoTester)
cc.t = 4000
for obj in c, cc:
autoTester.check (obj.x, obj.y, obj.yy, obj.z, obj.zz, obj.t, obj.a, obj.b)
autoTester.check (c.__repr__ ())
autoTester.check (cc.__repr__ ())
#__pragma__ ('opov')
autoTester.check (c == cc)
autoTester.check (c != cc)
autoTester.check (c < cc)
autoTester.check (c > cc)
autoTester.check (c <= cc)
autoTester.check (c >= cc)
autoTester.check (c == c)
autoTester.check (c != c)
autoTester.check (c < c)
autoTester.check (c > c)
autoTester.check (c <= c)
autoTester.check (c >= c)