Skip to content

Should we error on "not-recommended" behavior in static typing tests ? #16891

@anirudh2290

Description

@anirudh2290

This discussion stems from here : #16622 (comment)

The numpy documentation says the following about instantiating the dtype object using "{'field1': ..., 'field2': ..., ...}":

"This usage is discouraged, because it is ambiguous with the other dict-based construction method. If you have a field called ‘names’ and a field called ‘formats’ there will be a conflict."

I think static typing is a good place to catch not just "wrong" types used, but also to catch early such discouraged usage in numpy. So, IMO we should have the type checker error on such behavior. WDYT ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions