Releases: daboross/Transcrypt
Releases · daboross/Transcrypt
v0.1.12
This update:
- Updates from upstream
- Adds better support for decorators
- Fixes ValueError/KeyError instantiation with custom messages
- Improves repr, str, and float behavior
- Removes hacky things surrounding the 'typing' module. No extra typing support in this release
- Removes hack to allow pythonic methods on lodash/Memory results. This is useful, but could, in the future, lead to code being canceled on public servers.
Snapshot 4
This has all modifications so far, including ones which are hacked together and possibly inconsistent:
- Support for
__Terminal__
/ stdout in browser is removed for less code bloat when using node.js - Internal functions are cleaned up, mainly to remove
try/catch
whenever it can be replaced withif
. - Support for lists in
in
andnot in
operators is removed in favor of directly translating to JSin
/not in
- Generation of
list()
around list literals is removed. This has no change other than making the target code more clear - Generation of
dict()
around object/dict literals is removed. This removes support for usingkeys
,items
,clear
, etc. methods on dicts.- Note: this is a break from Python behavior, but it overall makes things more consistent (JS objects don't have these methods)
int()
behavior is changed to floor values when passed floats- All exceptions are changed to create JavaScript
Error
instances internally when created for stacktraces - Statements generated from
import x.y.z
are simplified repr()
andstr()
are simplified for faster handling of non-object valuesKeyError
andValueError
are fixed to support custom messages- Unsandboxed lodash prototypes in Screeps are modified to have pythonic array methods for consistency.
- This is somewhat dangerous, and while it's accepted in the current Screeps server verison, it may be disallowed in the future
- A
--noalias
cli option is added for specifying things not to alias for all python files (previously one would need to specify__noalias__
for each file individually) - The
typing
module is fleshed out with stub classes, rather than being empty - Special cases are added for variables named
TYPE_CHECKING
and functions namedcast
for extra support usingtyping
.