Lines Matching refs:ns
29 _PyNamespaceObject *ns = (_PyNamespaceObject *)self; in namespace_new() local
30 ns->ns_dict = PyDict_New(); in namespace_new()
31 if (ns->ns_dict == NULL) { in namespace_new()
32 Py_DECREF(ns); in namespace_new()
41 namespace_init(_PyNamespaceObject *ns, PyObject *args, PyObject *kwds) in namespace_init() argument
53 return PyDict_Update(ns->ns_dict, kwds); in namespace_init()
58 namespace_dealloc(_PyNamespaceObject *ns) in namespace_dealloc() argument
60 PyObject_GC_UnTrack(ns); in namespace_dealloc()
61 Py_CLEAR(ns->ns_dict); in namespace_dealloc()
62 Py_TYPE(ns)->tp_free((PyObject *)ns); in namespace_dealloc()
67 namespace_repr(PyObject *ns) in namespace_repr() argument
75 name = (Py_TYPE(ns) == &_PyNamespace_Type) ? "namespace" in namespace_repr()
76 : ns->ob_type->tp_name; in namespace_repr()
78 i = Py_ReprEnter(ns); in namespace_repr()
87 d = ((_PyNamespaceObject *)ns)->ns_dict; in namespace_repr()
140 Py_ReprLeave(ns); in namespace_repr()
147 namespace_traverse(_PyNamespaceObject *ns, visitproc visit, void *arg) in namespace_traverse() argument
149 Py_VISIT(ns->ns_dict); in namespace_traverse()
155 namespace_clear(_PyNamespaceObject *ns) in namespace_clear() argument
157 Py_CLEAR(ns->ns_dict); in namespace_clear()
176 namespace_reduce(_PyNamespaceObject *ns) in namespace_reduce() argument
183 result = PyTuple_Pack(3, (PyObject *)Py_TYPE(ns), args, ns->ns_dict); in namespace_reduce()
248 PyObject *ns = namespace_new(&_PyNamespace_Type, NULL, NULL); in _PyNamespace_New() local
249 if (ns == NULL) in _PyNamespace_New()
253 return ns; in _PyNamespace_New()
254 if (PyDict_Update(((_PyNamespaceObject *)ns)->ns_dict, kwds) != 0) { in _PyNamespace_New()
255 Py_DECREF(ns); in _PyNamespace_New()
259 return (PyObject *)ns; in _PyNamespace_New()