Skip to content

Export tuple type length function #36820

Closed
@NHDaly

Description

Originally posted by @NHDaly in #32427 (comment)

#32427 added an unexported function, _counttuple(::Type{<:Tuple}) which returns the number of elements in the tuple type.

Can we name this something not private and export it? This is something we use all the time in our code at RelationalAI, where we do a lot of stuff with tuples. It also seems like something that other code will use a lot, like DataFrames, CSV, etc.

In that other comment I suggested arity(::Type{<:Tuple}) as one suggestion. I still like that best, but open to others!

  • arity()
  • tupletypewidth() / tuple_type_width()
  • tupletypecount() / tuple_type_count()
  • tuplearity()
  • tupletypelength() / tuple_type_length()

Metadata

Assignees

No one assigned

    Labels

    good first issueIndicates a good issue for first-time contributors to Julianeeds decisionA decision on this change is neededstdlibJulia's standard library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions