From c47742190b3614789b3c16c439764e05a630bca6 Mon Sep 17 00:00:00 2001 From: 0dminnimda <0dminnimda@gmail.com> Date: Tue, 20 Jul 2021 23:27:23 +0300 Subject: Document `typeof` in pure.rst (GH-4301) --- docs/src/tutorial/pure.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/src/tutorial/pure.rst b/docs/src/tutorial/pure.rst index 86e62a9d3..f31821d1f 100644 --- a/docs/src/tutorial/pure.rst +++ b/docs/src/tutorial/pure.rst @@ -243,6 +243,13 @@ Further Cython functions and declarations print(cython.sizeof(cython.longlong)) print(cython.sizeof(n)) +* ``typeof`` returns a string representation of the argument's type for debugging purposes. It can take expressions. + + :: + + cython.declare(n=cython.longlong) + print(cython.typeof(n)) + * ``struct`` can be used to create struct types.:: MyStruct = cython.struct(x=cython.int, y=cython.int, data=cython.double) -- cgit v1.2.1