[New-bugs-announce] [issue29580] "Built-in Functions" not being functions

Stefan Pochmann report at bugs.python.org
Thu Feb 16 12:32:50 EST 2017


New submission from Stefan Pochmann:

About https://docs.python.org/3/library/functions.html: The title "Built-in Functions", the table header "Built-in Functions" and the "functions" in the URL all suggest that what's on this page are functions. But many things on that page don't appear to be functions, like "range" or "dict". They appear to be callable types instead. For example "range":

    >>> type(range)
    <class 'type'>
    >>> import types
    >>> isinstance(range, types.FunctionType)
    False
    >>> isinstance(range, types.BuiltinFunctionType)
    False

Compare with "abs":

    >>> type(abs)
    <class 'builtin_function_or_method'>
    >>> isinstance(abs, types.FunctionType)
    False
    >>> isinstance(abs, types.BuiltinFunctionType)
    True

The text between title and table talks about "functions and types", but the title/tableheader/URL disagree.

Also, the table is wrong in saying that "abs()" etc are functions. Should say "abs" instead, i.e., remove the "()".

Many, like "abs", aren't even allowed to be called like that, as it results in "TypeError: abs() takes exactly one argument (0 given)".

----------
assignee: docs at python
components: Documentation
messages: 287961
nosy: Stefan Pochmann, docs at python
priority: normal
severity: normal
status: open
title: "Built-in Functions" not being functions
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29580>
_______________________________________


More information about the New-bugs-announce mailing list