Skip to content

Commit

Permalink
Module datetime added
Browse files Browse the repository at this point in the history
  • Loading branch information
JdeH committed Jan 6, 2018
1 parent 32ec5b2 commit c16b8bd
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Also, code can be tested from the command prompt using stubs.
Main differences with CPython
=============================

- Web batteries: Seamless access to any existing JavaScript library has been favored over inclusion of many Python libraries in the distribution. There are some exceptions to this rule, e.g. math, cmath, random, itertools, re, time and turtle, and some more may follow, but in general the accent is on libraries that are relevant in the browser.
- Web batteries: Seamless access to any existing JavaScript library has been favored over inclusion of many Python libraries in the distribution. There are some exceptions to this rule, e.g. math, cmath, random, itertools, re, time, datetime and turtle, and some more may follow, but in general the accent is on libraries that are relevant in the browser.
- No eval and exec of Python code. This is again part of the concept. Transcrypt code is compiled, optimized and minified in advance to warant fast page loads. In this respect its design goal is fundamentally different from tools that compile on the fly in the browser. Transcrypt is targeted towards building professional, extensive, real world web applications that load and run as fast as their JavaScript counterparts, but offers Pythonically clean, modular structure and maintainability.

License
Expand Down Expand Up @@ -121,6 +121,8 @@ Each release, on the other hand, is preceded by at least the following tests:
What's new in the latest commits
================================

- Examples for datetime, time and re added to docs
- Module datetime added (pr 435)
- Conjugate of real now compiled correctly
- Property decorators now supported for getters and setters
- Metaclasses and method decorators now execute in correct order (issue 430)
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "transcrypt",
"version": "3.6.80",
"version": "3.6.82",
"description": "Python 3.6 in the browser, precompiled for fast, small code. Source level debugging. Works seamlessly with any JavaScript library.",
"license": "Apache-2.0",
"scripts": {
Expand Down
45 changes: 45 additions & 0 deletions transcrypt/docs/sphinx/supported_constructs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ Module cmath: allmost all of Python's cmath module
:tab-width: 4
:caption: Testlet: module_cmath

Module datetime: transcryption of Python's datetime module
----------------------------------------------------------

.. literalinclude:: ../../development/automated_tests/transcrypt/module_datetime/__init__.py
:tab-width: 4
:caption: Testlet: module_datetime

Module itertools: allmost all of Python's itertools module
----------------------------------------------------------

Expand All @@ -269,6 +276,44 @@ Module random: most important functions of Python's random module
:tab-width: 4
:caption: Manual_test: module_random

Module re: transcryption of Python's re module
----------------------------------------------

.. literalinclude:: ../../development/automated_tests/re/autotest.py
:tab-width: 4
:caption: Testlet: re/autotest

.. literalinclude:: ../../development/automated_tests/re/basictests.py
:tab-width: 4
:caption: Testlet: re/basictests

.. literalinclude:: ../../development/automated_tests/re/basic_pyre.py
:tab-width: 4
:caption: Testlet: re/basic_pyre

.. literalinclude:: ../../development/automated_tests/re/basic_jsre.py
:tab-width: 4
:caption: Testlet: re/basictests

Module time: transcryption of Python's time module
--------------------------------------------------

.. literalinclude:: ../../development/automated_tests/time/autotest.py
:tab-width: 4
:caption: Testlet: time/testlet0

.. literalinclude:: ../../development/automated_tests/time/testlet0.py
:tab-width: 4
:caption: Testlet: time/testlet0

.. literalinclude:: ../../development/automated_tests/time/mult_time.py
:tab-width: 4
:caption: Testlet: time/mult_time

.. literalinclude:: ../../development/automated_tests/time/strptime.py
:tab-width: 4
:caption: Testlet: time/strptime

Modules: hierarchical, both local to the project and global url-based
---------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion transcrypt/modules/org/transcrypt/__base__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class __Envir__:
def __init__ (self):
self.interpreter_name = 'python'
self.transpiler_name = 'transcrypt'
self.transpiler_version = '3.6.81'
self.transpiler_version = '3.6.82'
self.target_subdir = '__javascript__'

__envir__ = __Envir__ ()

0 comments on commit c16b8bd

Please sign in to comment.