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

improved eltype for flatten with tuple argument #55946

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matthias314
Copy link
Contributor

@matthias314 matthias314 commented Oct 1, 2024

We have always had

julia> t = (Int16[1,2], Int32[3,4]); eltype(Iterators.flatten(t))
Any

With this PR, the result is Signed (promote_typejoin applied to the element types of the tuple elements).

The same applies to NamedTuple:

julia> nt = (a = [1,2], b = (3,4)); eltype(Iterators.flatten(nt))
Any     # old
Int64   # new

@matthias314 matthias314 marked this pull request as draft October 1, 2024 00:18
@matthias314 matthias314 changed the title improve eltype for Iterators.flatten with Tuple argument improve deltype for flatten with tuple argument Oct 1, 2024
@matthias314 matthias314 changed the title improve deltype for flatten with tuple argument improved eltype for flatten with tuple argument Oct 1, 2024
@matthias314 matthias314 marked this pull request as ready for review October 1, 2024 01:24
@nsajko nsajko added domain:collections Data structures holding multiple items, e.g. sets domain:iteration Involves iteration or the iteration protocol labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:collections Data structures holding multiple items, e.g. sets domain:iteration Involves iteration or the iteration protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants