Skip to content

Releases: daboross/Transcrypt

v0.1.12

26 Nov 01:23
Compare
Choose a tag to compare

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

26 Nov 02:38
Compare
Choose a tag to compare
Snapshot 4 Pre-release
Pre-release

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 with if.
  • Support for lists in in and not in operators is removed in favor of directly translating to JS in / 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 using keys, 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() and str() are simplified for faster handling of non-object values
  • KeyError and ValueError 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 named cast for extra support using typing.