Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103619 > unrolled thread

Re: Bug in Python?

Started by"Sven R. Kunze" <srkunze@mail.de>
First post2016-02-28 10:52 +0100
Last post2016-02-28 10:52 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Bug in Python? "Sven R. Kunze" <srkunze@mail.de> - 2016-02-28 10:52 +0100

#103619 — Re: Bug in Python?

From"Sven R. Kunze" <srkunze@mail.de>
Date2016-02-28 10:52 +0100
SubjectRe: Bug in Python?
Message-ID<mailman.4.1456653176.9760.python-list@python.org>
On 26.02.2016 23:37, Ian Kelly wrote:
> On Fri, Feb 26, 2016 at 3:08 PM, Sven R. Kunze <srkunze@mail.de> wrote:
>> Python sometimes seems not to hop back and forth between C and Python code.
> C code as a rule tends to ignore dunder methods. Those are used to
> implement Python operations, not C operations.

Ah, good to know.

>>          _siftup(heap, 0)    # that's C
> Your comment here appears to be incorrect.
>
> [snip]
>
> So I would guess that the difference here is because one
> implementation is entirely C, and the other implementation is entirely
> Python.

You are damn right. While implementing xheap and looking at the C 
implementation, I just assumed that all Python functions would be 
replaced by when the C module is imported. Furthermore, the C module 
exports some internal functions (leading _ ) such as _heappop_max. Thus, 
I assumed this is true for _siftup without verifying it by looking too 
closely at the PyMethodDef and PyModuleDef structs. Sorry for that.

Best,
Sven

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web