Commit 8d7c1d9 1 parent 057f9bf commit 8d7c1d9 Copy full SHA for 8d7c1d9
File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -93,11 +93,14 @@ This is equivalent to omitting the generic notation and just saying
93
93
User-defined generic types
94
94
--------------------------
95
95
96
- You can define a user-defined class as generic in three ways: by including a
97
- ``Generic `` base class, by using the new generic class syntax in Python 3.12
98
- and higher, or by including a ``Protocol `` base class parameterized with type
99
- variables. The third approach also marks the class as a protocol - see
100
- :ref: `generic protocols<generic-protocols> ` for more information.
96
+ There are several ways to define a user-defined class as generic:
97
+
98
+ * Include a ``Generic `` base class.
99
+ * Use the new generic class syntax in Python 3.12 and higher.
100
+ * Include a `` Protocol`` base class parameterized with type variables. This
101
+ approach also marks the class as a protocol - see
102
+ :ref: `generic protocols<generic-protocols> ` for more information.
103
+ * Include a generic base class parameterized with type variables.
101
104
102
105
Example using ``Generic ``::
103
106
You can’t perform that action at this time.
0 commit comments