Skip to content

implicit-any-attribute reported for __slots__ = () in numpy #3381

Closed

Description

@jorenham

Describe the Bug

The type of __slots__ class attributes is trivial, so there should be no need to explicitly annotate the type of __slots__ = (). However, when implicit-any is enabled, then starting with Pyrefly 0.64.0, an implicit-any-attribute will be reported:

class A:
    __slots__ = ()

ERROR sandbox.py:2:17-19: This expression is implicitly inferred to be tuple[Any, ...]. Please provide an explicit type annotation. [implicit-any-attribute]

This is affecting numpy: https://github.com/numpy/numpy/actions/runs/25818437875/job/75853007592?pr=31427

Sandbox Link

https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQCCiAOuvR-QPpdxS4AXOD3oBeegAoAlGxAAaEGQBOMMFFKEBuALZQKAbRhKluJXAC6bCNuJQIlCAIC0GUmPosQRk0s%2ByAvgqolAIQAG4wAGLQMBRoWHhEZCD%2BQA

(Only applicable for extension issues) IDE Information

No response

Activity

  1. self-assigned this
    on May 13, 2026
  2. jorenham commented on May 14, 2026

    @jorenham
    CollaboratorAuthor
  3. added this to the v1.0.1 milestone on May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions