[New-bugs-announce] [issue47214] builtin_function_or_method is also either a function or a method

Ravi Jain report at bugs.python.org
Mon Apr 4 07:51:09 EDT 2022


New submission from Ravi Jain <aivainjr141 at gmail.com>:

the.
```
import inspect
inspect.isfunction
```
does not consider a
```
builtin_function_or_method
```
as a function.
for example,
```
inspect.isfunction(abs)
```
gives,
```
False
```
in the background even the builtin `abs` is a function, so shouldn't it return True?

the way this check is implemented is by matching the type of a builtin_function_or_method with,
```
type(len)
```
and since, `type(len)` is `builtin_function_or_method`, so, the `inspect.isfunction` check gives False.
But in my opinion, it should return True, even for builtin functions or methods.

----------
components: Build
messages: 416664
nosy: apostofes
priority: normal
severity: normal
status: open
title: builtin_function_or_method is also either a function or a method
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47214>
_______________________________________


More information about the New-bugs-announce mailing list