Welcome to Transcrypt’s documentation!¶
Can’t find what you’re looking for? The on-line version of this documentation is frequently updated, reflecting the newest features and troubleshooting procedures.
Table of Contents:¶
- 1. Transcrypt: what and why
- 2. Getting started
- 3. Special facilities
- 3.1. Transcrypt’s module mechanism
- 3.2. Using browser stubs to test non-GUI code that uses console.log and window.alert
- 3.3. Creating JavaScript objects with __new__ (<constructor call>)
- 3.4. Identifier aliasing: __pragma__ (‘alias’, ...) and __pragma__ (‘noalias’, ...)
- 3.5. Preventing target annotation: __pragma__ (‘noanno’)
- 3.6. Surpassing the speed of native JavaScript: __pragma__ (‘fcall’) and __pragma (‘nofcall’)
- 3.7. Automatic conversion to iterable: __pragma__ (‘iconv’) and __pragma__ (‘noiconv’)
- 3.8. Inserting literal JavaScript: __pragma__ (‘js’, ...) and include (...)
- 3.9. Keeping your code lean: __pragma__ (‘kwargs’) and __pragma__ (‘nokwargs’)
- 3.10. Operator overloading: __pragma__ (‘opov’) and __pragma__ (‘noopov’)
- 3.11. Skipping fragments while generating code : __pragma__ (‘skip’) and __pragma__ (‘noskip’)
- 4. Systematic code examples: a guided tour of Transcrypt
- 4.1. Arguments: **kwargs, *args, defaults, at call and def time, also for lambda’s
- 4.2. Classes: multiple inheritance and assignment of bound functions
- 4.3. Conditional expressions: simple and nested
- 4.4. Control structures: for...else, while...else, if...elif...else, break, continue
- 4.5. Data structures: tuple, list, dict, set
- 4.6. Dict comprehensions
- 4.7. Dictionaries: dict revisited
- 4.8. Exceptions: exception class hierarchy, finally
- 4.9. General functions: sort and sorted
- 4.10. Hierarchical modules: both local to the project and global url-based
- 4.11. Indices and slices: LHS, RHS, basic and extended
- 4.12. Lambda functions with all types of args
- 4.13. List comprehensions: multi-loop and nested with multiple if’s
- 4.14. Operator overloading
- 4.15. Properties
- 4.16. Set comprehensions
- 4.17. Simple and augmented assignment
- 4.18. Tuple assignment: recursive and in for-headers using enumerate
- 5. Integration with JavaScript libraries
- 6. Autotesting Transcrypt code