@@ -42,7 +42,7 @@ To support this, we suggest organizing content from most important to
4242least important: principal classes first, then supporting classes, then
4343implementation details. This way, readers can start at the top and
4444immediately see what matters most. Unlike C/C++ where definitions must
45- precede uses, Python imposes no such constraint— we're free to optimize
45+ precede uses, Python imposes no such constraint, so we're free to optimize
4646for the reader.
4747
4848These are guidelines, not rules. Place helper functions near their call
@@ -118,7 +118,7 @@ element comes first among the definitions.
118118
119119Other public classes and functions follow. These might include auxiliary
120120classes (e.g., ``DeviceMemoryResourceOptions ``), abstract base classes,
121- or additional exports. Organize them logically— by related functionality
121+ or additional exports. Organize them logically, such as by related functionality
122122or typical usage.
123123
124124.. _8-public-module-functions :
@@ -604,7 +604,7 @@ Helper Functions
604604
605605When a class grows long or a method becomes deeply nested, consider
606606extracting implementation details into helper functions. The goal is to
607- keep class definitions easy to navigate—readers shouldn't have to scroll
607+ keep class definitions easy to navigate. Readers shouldn't have to scroll
608608through hundreds of lines to understand a class's interface.
609609
610610In Cython files, helpers are typically ``cdef `` or ``cdef inline ``
@@ -1147,7 +1147,7 @@ points to the caller:
11471147
11481148 warnings.warn(message, UserWarning , stacklevel = 3 )
11491149
1150- The value depends on call depth— typically ``stacklevel=2 `` for direct
1150+ The value depends on call depth: typically ``stacklevel=2 `` for direct
11511151calls, ``stacklevel=3 `` when called through a helper.
11521152
11531153CUDA-Specific Patterns
@@ -1181,9 +1181,10 @@ Group multiple driver calls in a single block:
11811181
11821182.. code :: python
11831183
1184- cdef int low, high
1184+ cdef int low, high, value
11851185 with nogil:
11861186 HANDLE_RETURN(cydriver.cuCtxGetStreamPriorityRange(& low, & high))
1187+ HANDLE_RETURN(cydriver.cuDeviceGetAttribute(& value, attr, device_id))
11871188
11881189 Raising Exceptions from ``nogil `` Context
11891190^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1213,7 +1214,7 @@ two phases:
12131214 better performance.
12141215
12151216This approach separates correctness from optimization. Getting the logic
1216- right first— with Python's better error messages and stack traces— often
1217+ right first, with Python's better error messages and stack traces, often
12171218saves time overall.
12181219
12191220Python Implementation
0 commit comments