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

simplify a type: Tuple{<:T} -> Tuple{T} #1109

Closed
wants to merge 1 commit into from
Closed

Conversation

nsajko
Copy link

@nsajko nsajko commented Dec 9, 2024

julia> Tuple{<:Int, <:Int, <:AbstractFloat} == Tuple{Int, Int, AbstractFloat}
true

```julia-repl
julia> Tuple{<:Int, <:Int, <:AbstractFloat} == Tuple{Int, Int, AbstractFloat}
true
```
Copy link
Member

@Datseris Datseris left a comment

Choose a reason for hiding this comment

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

This change has no functional impact on the code base. However, it does have readibility impact. To understand this change, one has to understand the internals of Tuples, the special Julia type whose type parameters are covariant: https://docs.julialang.org/en/v1/devdocs/types/#Tuple-types

I didn't know about this, and in fact with the PR I got confused thinking "how can this work???". So, in conclusion, there is no reason to do this change, as it only requires the reader of the source code to have an even more advanced knowledge of Julia. The current version of the source code requires standard knowledge of parametric subtyping.

@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.78%. Comparing base (8b5b456) to head (ff13a65).
Report is 155 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1109       +/-   ##
===========================================
+ Coverage   70.12%   85.78%   +15.66%     
===========================================
  Files          42       37        -5     
  Lines        2718     2540      -178     
===========================================
+ Hits         1906     2179      +273     
+ Misses        812      361      -451     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nsajko
Copy link
Author

nsajko commented Dec 9, 2024

Yeah, this is just a stylistic change. Your choice.

@nsajko nsajko closed this Dec 9, 2024
@nsajko nsajko deleted the b branch December 9, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants