Mercurial > pymonkey
comparison undefined.c @ 10:29eaa1fceff1
Moved definition of undefined type into a separate module.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 28 Jun 2009 17:10:40 -0700 |
parents | |
children | bc4263c6ae82 |
comparison
equal
deleted
inserted
replaced
9:032cfc448079 | 10:29eaa1fceff1 |
---|---|
1 #include "undefined.h" | |
2 | |
3 // TODO: We should make this behave as much like JavaScript's | |
4 // "undefined" value as possible; e.g., its string value should | |
5 // be "undefined", the singleton should be falsy, etc. | |
6 PyTypeObject PYM_undefinedType = { | |
7 PyObject_HEAD_INIT(NULL) | |
8 0, /*ob_size*/ | |
9 "pymonkey.undefined", /*tp_name*/ | |
10 sizeof(PYM_undefinedObject), /*tp_basicsize*/ | |
11 0, /*tp_itemsize*/ | |
12 0, /*tp_dealloc*/ | |
13 0, /*tp_print*/ | |
14 0, /*tp_getattr*/ | |
15 0, /*tp_setattr*/ | |
16 0, /*tp_compare*/ | |
17 0, /*tp_repr*/ | |
18 0, /*tp_as_number*/ | |
19 0, /*tp_as_sequence*/ | |
20 0, /*tp_as_mapping*/ | |
21 0, /*tp_hash */ | |
22 0, /*tp_call*/ | |
23 0, /*tp_str*/ | |
24 0, /*tp_getattro*/ | |
25 0, /*tp_setattro*/ | |
26 0, /*tp_as_buffer*/ | |
27 Py_TPFLAGS_DEFAULT, /*tp_flags*/ | |
28 /* tp_doc */ | |
29 "Pythonic equivalent of JavaScript's 'undefined' value", | |
30 }; | |
31 | |
32 PyObject *PYM_undefined = (PyObject *) &PYM_undefinedType; |