Commits

Amaury Forgeot d'Arc committed 3a643e3

Add _decimal.Decimal, empty.

  • Participants
  • Parent commits ffe162a
  • Branches decimal-libmpdec

Comments (0)

Files changed (3)

File pypy/module/_decimal/__init__.py

         }
     
     interpleveldefs = {
+        'Decimal': 'interp_decimal.W_Decimal',
         'IEEE_CONTEXT_MAX_BITS': 'space.wrap(interp_decimal.IEEE_CONTEXT_MAX_BITS)',
         }

File pypy/module/_decimal/interp_decimal.py

 from rpython.rlib import rmpdec
+from pypy.interpreter.baseobjspace import W_Root
+from pypy.interpreter.typedef import (TypeDef, GetSetProperty, descr_get_dict,
+    descr_set_dict, descr_del_dict)
+
 
 IEEE_CONTEXT_MAX_BITS = rmpdec.MPD_IEEE_CONTEXT_MAX_BITS
+
+class W_Decimal(W_Root):
+    pass
+
+W_Decimal.typedef = TypeDef(
+    'Decimal')

File pypy/module/_decimal/test/test_module.py

     def test_constants(self):
         import _decimal
         assert _decimal.IEEE_CONTEXT_MAX_BITS > 3
+
+    def test_type(self):
+        import _decimal
+        assert isinstance(_decimal.Decimal, type)