diff --git a/src/PyVector.cpp b/src/PyVector.cpp index f5c5900..acb60c0 100644 --- a/src/PyVector.cpp +++ b/src/PyVector.cpp @@ -4,8 +4,10 @@ #include PyGetSetDef PyVector::getsetters[] = { - {"x", (getter)PyVector::get_member, (setter)PyVector::set_member, "X/horizontal component", (void*)0}, - {"y", (getter)PyVector::get_member, (setter)PyVector::set_member, "Y/vertical component", (void*)1}, + {"x", (getter)PyVector::get_member, (setter)PyVector::set_member, + MCRF_PROPERTY(x, "X coordinate of the vector (float)"), (void*)0}, + {"y", (getter)PyVector::get_member, (setter)PyVector::set_member, + MCRF_PROPERTY(y, "Y coordinate of the vector (float)"), (void*)1}, {NULL} }; diff --git a/tools/test_vector_docs.py b/tools/test_vector_docs.py index a908f64..bf07e47 100644 --- a/tools/test_vector_docs.py +++ b/tools/test_vector_docs.py @@ -23,5 +23,17 @@ assert "Return a unit vector" in normalize_doc assert "Returns:" in normalize_doc assert "Note:" in normalize_doc +# Check Vector.x property docstring +x_doc = mcrfpy.Vector.x.__doc__ +print("x property doc:", x_doc) +assert "X coordinate of the vector" in x_doc +assert "float" in x_doc + +# Check Vector.y property docstring +y_doc = mcrfpy.Vector.y.__doc__ +print("y property doc:", y_doc) +assert "Y coordinate of the vector" in y_doc +assert "float" in y_doc + print("SUCCESS: All docstrings present and complete") sys.exit(0)