diff --git a/gdstk/_gdstk.pyi b/gdstk/_gdstk.pyi index 3fa18b39..1899a0e6 100644 --- a/gdstk/_gdstk.pyi +++ b/gdstk/_gdstk.pyi @@ -39,7 +39,7 @@ class Cell: deep_copy: bool = True, ) -> Cell: ... def delete_property(self, name: str) -> Self: ... - def dependencies(self, recursive: bool = True) -> Sequence[Self | RawCell]: ... + def dependencies(self, recursive: bool = True) -> Sequence[Cell | RawCell]: ... def filter( self, spec: Iterable[tuple[int, int]], @@ -496,7 +496,7 @@ class RawCell: name: str size: int def __init__(self, name: str)-> None: ... - def dependencies(self, recursive: bool) -> list[RawCell]: ... + def dependencies(self, recursive: bool = True) -> list[RawCell]: ... class Reference: cell: Cell diff --git a/python/cell_object.cpp b/python/cell_object.cpp index f9ed4553..e6c00e73 100644 --- a/python/cell_object.cpp +++ b/python/cell_object.cpp @@ -971,7 +971,7 @@ static PyObject* cell_object_remap(CellObject* self, PyObject* args, PyObject* k static PyObject* cell_object_dependencies(CellObject* self, PyObject* args, PyObject* kwds) { int recursive = 1; const char* keywords[] = {"recursive", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "p:dependencies", (char**)keywords, &recursive)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|p:dependencies", (char**)keywords, &recursive)) return NULL; Map cell_map = {}; diff --git a/python/rawcell_object.cpp b/python/rawcell_object.cpp index 3c06c7f6..4f2d9ca8 100644 --- a/python/rawcell_object.cpp +++ b/python/rawcell_object.cpp @@ -47,8 +47,8 @@ static int rawcell_object_init(RawCellObject* self, PyObject* args, PyObject* kw } static PyObject* rawcell_object_dependencies(RawCellObject* self, PyObject* args) { - int recursive; - if (!PyArg_ParseTuple(args, "p:dependencies", &recursive)) return NULL; + int recursive = 1; + if (!PyArg_ParseTuple(args, "|p:dependencies", &recursive)) return NULL; Map rawcell_map = {}; self->rawcell->get_dependencies(recursive > 0, rawcell_map); PyObject* result = PyList_New(rawcell_map.count);