MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / py_is_init_method

Function py_is_init_method

internal/cbm/lsp/py_lsp.c:4417–4423  ·  view source on GitHub ↗

Return true iff func_node's name is __init__ or __post_init__. */

Source from the content-addressed store, hash-verified

4415
4416/* Return true iff func_node's name is __init__ or __post_init__. */
4417static bool py_is_init_method(PyLSPContext *ctx, TSNode func_node) {
4418 TSNode name = ts_node_child_by_field_name(func_node, "name", 4);
4419 if (ts_node_is_null(name))
4420 return false;
4421 char *nm = py_node_text(ctx, name);
4422 return nm && (strcmp(nm, "__init__") == 0 || strcmp(nm, "__post_init__") == 0);
4423}
4424
4425/* Decorator expressions of a decorated definition, in source order. They
4426 * evaluate in the scope enclosing the definition, before it is bound. A bare

Callers 1

py_process_classFunction · 0.85

Calls 1

py_node_textFunction · 0.85

Tested by

no test coverage detected