Skip to content

3.13.0b3: undocumented change in inspect.isroutine() for functools.partial #122087

Closed
@mgorny

Description

@mgorny

Documentation

While investigating encode/starlette#2648, I've noticed that the behavior of inspect.isroutine() changed with regards to functools.partial().

Please consider the following sample:

import inspect
from functools import partial

def foo(x):
    pass

p = partial(foo, 1)
print(inspect.isroutine(p))

Prior to 3.13.0b3, it would evaluate to False. In newer versions, it evaluates to True.

A bisect points out that it changed as a result of 49e5740 (i.e. #121086). Neither the commit message, nor the news entry, hints anything about inspect.isroutine() behavior.

Could you please clarify whether the change was intentional? And if it was, could we have it explicitly noted in the documentation?

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions