summaryrefslogtreecommitdiff
path: root/docs/examples/userguide/extension_types/dataclass.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/userguide/extension_types/dataclass.pyx')
-rw-r--r--docs/examples/userguide/extension_types/dataclass.pyx3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/examples/userguide/extension_types/dataclass.pyx b/docs/examples/userguide/extension_types/dataclass.pyx
index 0529890ba..b03d5f7b1 100644
--- a/docs/examples/userguide/extension_types/dataclass.pyx
+++ b/docs/examples/userguide/extension_types/dataclass.pyx
@@ -5,6 +5,7 @@ try:
except ImportError:
pass # The modules don't actually have to exists for Cython to use them as annotations
+
@cython.dataclasses.dataclass
cdef class MyDataclass:
# fields can be declared using annotations
@@ -16,5 +17,5 @@ cdef class MyDataclass:
c = "hello" # assignment of default value on a separate line
# typing.InitVar and typing.ClassVar also work
- d: dataclasses.InitVar[double] = 5
+ d: dataclasses.InitVar[cython.double] = 5
e: typing.ClassVar[list] = []