Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search_src and friends are case-sensitive #7320

Closed
jhpalmieri opened this issue Oct 27, 2009 · 7 comments
Closed

search_src and friends are case-sensitive #7320

jhpalmieri opened this issue Oct 27, 2009 · 7 comments
Assignees
Milestone

Comments

@jhpalmieri
Copy link
Member

The functions search_src, search_def, and search_src are case-sensitive and have been for a while. The documentation says that they're not. This patch changes the documentation to reflect this, and adds one doctest to verify it.

CC: @sagetrac-mvngu

Component: misc

Author: John Palmieri

Reviewer: Karl-Dieter Crisman

Merged: sage-4.2.1.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/7320

@jhpalmieri jhpalmieri added this to the sage-4.2.1 milestone Oct 27, 2009
@jhpalmieri jhpalmieri self-assigned this Oct 27, 2009
@jhpalmieri
Copy link
Member Author

Attachment: trac_7320-case-sensitive.patch.gz

@kcrisman
Copy link
Member

Reviewer: Karl-Dieter Crisman

@kcrisman
Copy link
Member

comment:2

Just out of curiosity, is it possible to change the behavior? Obviously that would be a different ticket. That could be useful (or not). Maybe a function that is, and another one that isn't...

The new patch is just making the notation for "case-sensitive" uniformly with hyphen, which seemed to be the majority of references in the doc; however, usage in general seems quite variable. One word for the adjective seems right, though. Maybe mvngu will have a comment, so I'm cc:ing him on this.

I also added a little to the doctests to make sure we're really doctesting the right thing and compare the two possibilities.

@kcrisman
Copy link
Member

Fixes a few things, adds doctest - use this

@jhpalmieri
Copy link
Member Author

comment:3

Attachment: trac_7320-case-sensitive.2.patch.gz

Replying to @kcrisman:

Just out of curiosity, is it possible to change the behavior? Obviously that would be a different ticket. That could be useful (or not). Maybe a function that is, and another one that isn't...

I think so: I think we can add a flag to the regular expression search to make it case-insensitive. We could add a flag (like ignore_case=False) to the search functions so people could toggle this. Of course, I haven't actually tried this, but the documentation for regular expression searches in Python suggests that it should be possible...

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Oct 30, 2009

comment:4

Replying to @kcrisman:

Maybe mvngu will have a comment, so I'm cc:ing him on this.

Sometimes I want to search the source with case-sensitivity on. For example, I might be interested in knowing if the source has anything with the word "Euler" in it. As function and method names are lower-case, case-sensitivity search might not return the name of a function/method like "euler_phi". However, if the documentation for "euler_phi" has something like "Euler phi function" or "Euler totient function", then case-sensitivity search would pick up "Euler". Sometimes I want to do a case-insensitivity search. In that case (pun not intended), I would expect that both "euler_phi" and "Euler" be returned by the search. At the end of the day, one can make case-insensitivity search as default, but should also give people the option to do case-sensitivity search. My 2-cent.

@mwhansen
Copy link
Contributor

Merged: sage-4.2.1.alpha0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants