Skip to content

DType parent class / type alias #189

Closed
@MarcoGorelli

Description

@MarcoGorelli

Also splitting this off from #187 (comment)

We have various dtypes: Int64, Int32, ...., Bool, which are part of the API.

We have functions which accept any dtype, such as

def column_from_sequence(sequence: Sequence[Scalar], *, dtype) -> Column:

How do we type dtype? I originally wanted to have DType be a common superclass of the dtypes, so we could have

def column_from_sequence(sequence: Sequence[Scalar], *, dtype: DType) -> Column:

but it's been brought up that this isn't desirable because it would add a class to the namespace for the sole purpose of type checking.

Are there alternatives which would be acceptable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    static typingtype annotations, use of type checkers directly from the spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions