Skip to content

Conversation

da-woods
Copy link
Contributor

I'm getting the impression that it this performance hint isn't sufficiently clear about what it wants you to modify.

(e.g. h5py/h5py#2268 (comment), but I've also seen other people confused by it too)

I'm getting the impression that it this performance hint isn't
sufficiently clear about what it wants you to modify.
@da-woods da-woods added this to the 3.0.x milestone Nov 28, 2023
Co-authored-by: Matus Valo <matusvalo@users.noreply.github.com>
on_what = "on '%s' " % function_name if function_name else ""
def write_noexcept_performance_hint(pos, env, function_name=None, void_return=False, is_call=False):
if is_call:
on_what = "after calling '%s' " % (function_name or 'function')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this now says "after calling 'function'". :-/ However, since we need the same kind of string below again, it seems best to quote the function name once and then just use it further down.

@da-woods da-woods merged commit 9385121 into cython:master Dec 1, 2023
@da-woods da-woods deleted the wording-for-performance-hint branch December 1, 2023 07:48
da-woods added a commit that referenced this pull request Dec 1, 2023
* Clarify performance hint wording

I'm getting the impression that it this performance hint isn't
sufficiently clear about what it wants you to modify.

* Update Cython/Compiler/PyrexTypes.py

Co-authored-by: Matus Valo <matusvalo@users.noreply.github.com>

* Simpify implementation

* Fiddle with escaping of function_name
@da-woods
Copy link
Contributor Author

da-woods commented Dec 1, 2023

In 3.0.x as 1db67b9

@da-woods da-woods modified the milestones: 3.0.x, 3.0.7 Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants