From 701b7a7fead71c8583bb38bb4ea8e4950aed0d89 Mon Sep 17 00:00:00 2001 From: keesbos Date: Tue, 13 Oct 2009 07:32:31 +0000 Subject: [PATCH] Implemented NotImplementedType and NotImplemented git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@2005 7a2bd370-bda8-463c-979e-2900ccfb811e --- CHANGELOG | 2 ++ pyjs/src/pyjs/builtin/pyjslib.py | 13 ++++++++++--- pyjs/src/pyjs/translator.py | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2f4185a6e..7d0272e23 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Changes made to Pyjamas since 0.6 --------------------------------- + * Implemented NotImplementedType and NotImplemented + * Implemented an int type and a long type * Add support for xrange and propper range (range was in fact an xrange) diff --git a/pyjs/src/pyjs/builtin/pyjslib.py b/pyjs/src/pyjs/builtin/pyjslib.py index 53319ef8f..58450d89a 100644 --- a/pyjs/src/pyjs/builtin/pyjslib.py +++ b/pyjs/src/pyjs/builtin/pyjslib.py @@ -31,8 +31,8 @@ break; } } -$max_int = 2147483647; -$min_int = -2147483648; +$max_int = 0x7fffffff; +$min_int = -0x80000000; """) class object: @@ -967,7 +967,6 @@ def init(): JS(""" pyjslib.abs = Math.abs; """) -# end of function init() class Class: def __init__(self, name): @@ -2983,6 +2982,14 @@ def float_int(value, radix=None): """@CONSTANT_DECLARATION@""" +class NotImplementedType(object): + def __repr__(self): + return "" + def __str__(self): + self.__repr__() + def toString(self): + self.__repr__() +NotImplemened = NotImplementedType() class List: @compiler.noSourceTracking diff --git a/pyjs/src/pyjs/translator.py b/pyjs/src/pyjs/translator.py index 0dad4ec90..628f52e13 100644 --- a/pyjs/src/pyjs/translator.py +++ b/pyjs/src/pyjs/translator.py @@ -281,7 +281,9 @@ "KeyError", "LookupError", "NameError", + "NotImplemented", # is in fact an instance "NotImplementedError", + "NotImplementedType", "RuntimeError", "StandardError", "StopIteration",