Skip to content

"_RmtreeType" not callable when passed to functools.partial on Python 3.12 #18637

Closed

Description

@Avasam

Bug Report

See reproducer, it's that simple. Probably partially caused by the 3.12+ definition of _RmtreeType on typeshed overloading the __call__ definition

To Reproduce

import functools, shutil
functools.partial(shutil.rmtree)

Expected Behavior

No error

Actual Behavior

error: "_RmtreeType" not callable [misc]

Your Environment

  • Mypy version used: mypy 1.15.0 (compiled: yes)
  • Mypy command-line flags: None
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.12.0 and 3.13.0

Activity

  1. hauntsaninja commented on Feb 9, 2025

    @hauntsaninja
    Collaborator

    Thanks, effectively a duplicate of #17585

  2. hauntsaninja commented on Feb 9, 2025

    @hauntsaninja
    Collaborator

    Although this issue can be fixed to not have the bad error message and only not fully support the overload logic...

  3. added a commit that references this issue on Feb 9, 2025
    6df3f57
  4. changed the title [-]`"_RmtreeType" not callable` when passed to `fucntools.partial` on Python 3.12[/-] [+]`"_RmtreeType" not callable` when passed to `functools.partial` on Python 3.12[/+] on Feb 9, 2025
  5. added a commit that references this issue on Feb 9, 2025
    876f636
  6. added a commit that references this issue on Feb 24, 2025
    c5d799d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions