Re: Is there a better way to create a list of None objects?

2021-08-12 Thread Matthieu Dartiailh
You can achieve the same result by writing: [None] * 8 Comparing both cases in IPython I get: In [1]: %timeit list((None,)*8) 110 ns ± 0.785 ns per loop (mean ± std. dev. of 7 runs, 1000 loops each) In [2]: %timeit [None] * 8 88.2 ns ± 0.432 ns per loop (mean ± std. dev. of 7 runs, 1000

Re: Calling an unbound method in C using the Public API

2018-09-05 Thread Matthieu Dartiailh
hiy Storchaka wrote: > > 29.08.18 17:33, Matthieu Dartiailh пише: >> I tried to look at the public C API for a way to call an unbound method with >> a minimal cost (in term of speed and memory). It seems to me, but please >> correct me if I am wrong, that one cannot call

Calling an unbound method in C using the Public API

2018-08-29 Thread Matthieu Dartiailh
Hi, I am one of the maintainer of the atom library (https://github.com/nucleic/atom ). This library provides low-memory footprint Python objects, descriptors and containers enforcing type validation, implements the observer pattern. For list, we basically subc