[Python-ideas] Fix that broken callable builtin

Chris Angelico rosuav at gmail.com
Sat Apr 18 23:34:12 CEST 2015


On Sun, Apr 19, 2015 at 7:27 AM, Ionel Cristian Mărieș
<contact at ionelmc.ro> wrote:
>
> On Sun, Apr 19, 2015 at 12:10 AM, Chris Angelico <rosuav at gmail.com> wrote:
>>
>> That's not true; there is a spec for the language, which is
>> independent of CPython, PyPy, etc, which are the implementations of
>> it.
>
>
> I'm not aware of such a document - can you point me to it? AFAIK `callable`
> is too old to be in a PEP. I hope you didn't have in mind the "docs as
> specification", that's not really a specification, it's a "state of things".

Not sure why the docs don't count as a spec. You're probably right
that callable() doesn't have any definition outside of the main docs,
but you generalized that to the entire language not having a spec,
which is definitely not the case.

But this thread could easily get coalesced into a simple line or two
in the docs, which then _would_ be the spec.

>> But in this case, the question isn't one of Python vs CPython, but one
>> of the use of application-level code. If this is considered a hack,
>> then it's not part of the language spec at all, but if it's deemed a
>> feature, then (a) every Python implementation will be required to
>> match it, and (b) other parts of the language (in this case,
>> callable()) will probably be required to acknowledge it.
>
> I wouldn't care about other python implementations, they are years behind
> CPython, and this is a very small change anyway. Why would this matter for
> them if they still implement python-2.7-language? It doesn't really make
> sense, unless you are considering to fix this in 2.7 too.

Uhh, that's not exactly true. Maybe it's true of the other three of
the Big Four (Jython, IronPython, PyPy), but there are several other
Pythons which are compliant with a version 3.x spec; MicroPython and
Brython come to mind.

ChrisA


More information about the Python-ideas mailing list