Skip to content

Enforce dtype for empty() #1790

Closed
Closed
@certik

Description

@certik

LPython should give an error message:

    x: i32[4, 5, 2] = empty([4, 5, 2])
    y: f64[24, 100, 2, 5] = empty([24, 100, 2, 5])

Since in CPython the arrays would be both float (?) arrays of the default kind. Instead, it needs to enforce something like this:

    from numpy import int32, float64
    x: i32[4, 5, 2] = empty([4, 5, 2], dtype=int32)
    y: f64[24, 100, 2, 5] = empty([24, 100, 2, 5], dtype=float64)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions