Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

chore: Rename Contains to IsSupersetOf#63062

Merged
varungandhi-src merged 2 commits into
mainfrom
vg/superset
Jun 4, 2024
Merged

chore: Rename Contains to IsSupersetOf#63062
varungandhi-src merged 2 commits into
mainfrom
vg/superset

Conversation

@varungandhi-src

Copy link
Copy Markdown
Contributor

The name Contains is also commonly used for checking if a
set contains an element in other languages, so it leads to
confusing auto-complete. Additionally, IsSupersetOf sounds
more expensive, which may be the case for this operation.

Test plan

Covered by existing tests

Changelog

@cla-bot cla-bot Bot added the cla-signed label Jun 4, 2024
@varungandhi-src varungandhi-src requested a review from a team June 4, 2024 05:10
@graphite-app

graphite-app Bot commented Jun 4, 2024

Copy link
Copy Markdown

(Notifying @sourcegraph/source of a change that affects gitserver)

@graphite-app graphite-app Bot added the team/source Tickets under the purview of Source - the one Source to graph it all label Jun 4, 2024
@github-actions github-actions Bot added team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform labels Jun 4, 2024
The name Contains is also commonly used for checking if a
set contains an element in other languages, so it leads to
confusing auto-complete. Additionally, IsSupersetOf sounds
more expensive, which may be the case for this operation.
Comment thread internal/collections/set_test.go Outdated
Comment thread internal/collections/set_test.go Outdated
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
@varungandhi-src varungandhi-src merged commit e55003d into main Jun 4, 2024
@varungandhi-src varungandhi-src deleted the vg/superset branch June 4, 2024 09:14
@unknwon

unknwon commented Jun 4, 2024

Copy link
Copy Markdown
Contributor

not a native speaker... "A contains B" to me means A >= B, "A is superset of B" means A > B, which changes the semantic meaning to me. Or does "superset" also implies >= relation?

@varungandhi-src

Copy link
Copy Markdown
Contributor Author

In usual math terminology, "superset" includes the equals case, yes.

Most math textbooks use ⊇ for superset and ⊃ for strict superset (at least one element is different). Sometimes ⊃ is used for superset and ⊋ is used for strict superset.

Relevant section on Wikipedia

@unknwon

unknwon commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

In usual math terminology, "superset" includes the equals case, yes.

Most math textbooks use ⊇ for superset and ⊃ for strict superset (at least one element is different). Sometimes ⊃ is used for superset and ⊋ is used for strict superset.

Relevant section on Wikipedia

TIL, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed team/graph Graph Team (previously Code Intel/Language Tools/Language Platform) team/product-platform team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants