1/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5static PyObject *
6mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping);
7
8static PyObject *
9mappingproxy_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
10{
11 PyObject *return_value = NULL;
12 static const char * const _keywords[] = {"mapping", NULL};
13 static _PyArg_Parser _parser = {NULL, _keywords, "mappingproxy", 0};
14 PyObject *argsbuf[1];
15 PyObject * const *fastargs;
16 Py_ssize_t nargs = PyTuple_GET_SIZE(args);
17 PyObject *mapping;
18
19 fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 1, 0, argsbuf);
20 if (!fastargs) {
21 goto exit;
22 }
23 mapping = fastargs[0];
24 return_value = mappingproxy_new_impl(type, mapping);
25
26exit:
27 return return_value;
28}
29
30PyDoc_STRVAR(property_init__doc__,
31"property(fget=None, fset=None, fdel=None, doc=None)\n"
32"--\n"
33"\n"
34"Property attribute.\n"
35"\n"
36" fget\n"
37" function to be used for getting an attribute value\n"
38" fset\n"
39" function to be used for setting an attribute value\n"
40" fdel\n"
41" function to be used for del\'ing an attribute\n"
42" doc\n"
43" docstring\n"
44"\n"
45"Typical use is to define a managed attribute x:\n"
46"\n"
47"class C(object):\n"
48" def getx(self): return self._x\n"
49" def setx(self, value): self._x = value\n"
50" def delx(self): del self._x\n"
51" x = property(getx, setx, delx, \"I\'m the \'x\' property.\")\n"
52"\n"
53"Decorators make defining new properties or modifying existing ones easy:\n"
54"\n"
55"class C(object):\n"
56" @property\n"
57" def x(self):\n"
58" \"I am the \'x\' property.\"\n"
59" return self._x\n"
60" @x.setter\n"
61" def x(self, value):\n"
62" self._x = value\n"
63" @x.deleter\n"
64" def x(self):\n"
65" del self._x");
66
67static int
68property_init_impl(propertyobject *self, PyObject *fget, PyObject *fset,
69 PyObject *fdel, PyObject *doc);
70
71static int
72property_init(PyObject *self, PyObject *args, PyObject *kwargs)
73{
74 int return_value = -1;
75 static const char * const _keywords[] = {"fget", "fset", "fdel", "doc", NULL};
76 static _PyArg_Parser _parser = {NULL, _keywords, "property", 0};
77 PyObject *argsbuf[4];
78 PyObject * const *fastargs;
79 Py_ssize_t nargs = PyTuple_GET_SIZE(args);
80 Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 0;
81 PyObject *fget = NULL;
82 PyObject *fset = NULL;
83 PyObject *fdel = NULL;
84 PyObject *doc = NULL;
85
86 fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 0, 4, 0, argsbuf);
87 if (!fastargs) {
88 goto exit;
89 }
90 if (!noptargs) {
91 goto skip_optional_pos;
92 }
93 if (fastargs[0]) {
94 fget = fastargs[0];
95 if (!--noptargs) {
96 goto skip_optional_pos;
97 }
98 }
99 if (fastargs[1]) {
100 fset = fastargs[1];
101 if (!--noptargs) {
102 goto skip_optional_pos;
103 }
104 }
105 if (fastargs[2]) {
106 fdel = fastargs[2];
107 if (!--noptargs) {
108 goto skip_optional_pos;
109 }
110 }
111 doc = fastargs[3];
112skip_optional_pos:
113 return_value = property_init_impl((propertyobject *)self, fget, fset, fdel, doc);
114
115exit:
116 return return_value;
117}
118/*[clinic end generated code: output=916624e717862abc input=a9049054013a1b77]*/
119